D-Programming-Language/dmd — pull request #725 by kennytm (2012-02-16 14:30:02+00:00)
Title: Fix bug 7399: Broken import statement in trySemantic() causes silent compiler error

http://d.puremagic.com/issues/show_bug.cgi?id=7399

This patch is a hack. It make `Module::read()` not to call `fatal()` when the system is gagging, and make `Module::load()` return NULL when read failed. Some null-checks are introduced in several other places as a result.

Proper fix would require exceptions be enabled (by using a `throw` statement instead of `exit(EXIT_FAILURE)` in `fatal()`) and incorporate RAII, which would be too difficult to change at this stage.