Avoided crashes when generating code corresponding to translation units at invalid locations.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>