Commit 7516c368 by Ian Lance Taylor

Don't crash if package import fails.

From-SVN: r168477
parent 1b702989
......@@ -330,8 +330,11 @@ Gogo::import_package(const std::string& filename,
Import imp(stream, location);
imp.register_builtin_types(this);
Package* package = imp.import(this, local_name, is_local_name_exported);
this->imports_.insert(std::make_pair(filename, package));
package->set_is_imported();
if (package != NULL)
{
this->imports_.insert(std::make_pair(filename, package));
package->set_is_imported();
}
delete stream;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment