From: Ian Lance Taylor Date: Thu, 12 Dec 2013 19:25:29 +0000 (+0000) Subject: compiler: Don't permit importing a package as "init". X-Git-Tag: releases/gcc-4.9.0~2114 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4201f42320db73ef0f5ec388ec40c03caaa545fe;p=thirdparty%2Fgcc.git compiler: Don't permit importing a package as "init". From-SVN: r205938 --- diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index e16b0d3a59e6..045763c7bee8 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -440,6 +440,9 @@ Gogo::import_package(const std::string& filename, return; } + if (local_name == "init") + error_at(location, "cannot import package as init"); + if (filename == "unsafe") { this->import_unsafe(local_name, is_local_name_exported, location);