diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-02-22 03:23:36 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-02-22 03:23:36 +0000 |
commit | 5b32f0e6168aa3941e5b78d53409bf21ef6ceb90 (patch) | |
tree | 2584ecee720d50e42dad2b38817fa86bc3145455 /gcc | |
parent | 6042d1dd489cd2188a6eee867a580aa664cc742b (diff) | |
download | gcc-5b32f0e6168aa3941e5b78d53409bf21ef6ceb90.zip gcc-5b32f0e6168aa3941e5b78d53409bf21ef6ceb90.tar.gz gcc-5b32f0e6168aa3941e5b78d53409bf21ef6ceb90.tar.bz2 |
Don't crash import unsafe if "unsafe" was already defined.
From-SVN: r170389
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/unsafe.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/unsafe.cc b/gcc/go/gofrontend/unsafe.cc index e219f61..9d51b4d 100644 --- a/gcc/go/gofrontend/unsafe.cc +++ b/gcc/go/gofrontend/unsafe.cc @@ -24,6 +24,13 @@ Gogo::import_unsafe(const std::string& local_name, bool is_local_name_exported, is_local_name_exported, "libgo_unsafe", location, &add_to_globals); + + if (package == NULL) + { + gcc_assert(saw_errors()); + return; + } + package->set_is_imported(); Bindings* bindings = package->bindings(); |