compiler: Don't make erroneous type descriptors.
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 3 Aug 2015 18:53:56 +0000 (18:53 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 3 Aug 2015 18:53:56 +0000 (18:53 +0000)
    There is no need to make type descriptors for named types when there
    are errors during package compilation.  Particularly, if the error in
    package compilation is from a malformed named type, there is no
    guarantee a type descriptor can be created.

    Fixes golang/go#11560.

    Reviewed-on: https://go-review.googlesource.com/12792

From-SVN: r226527

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/gogo.cc

index 5490d9f7fa9b0ba278ccff5c1c84b1601393e9e8..e3a971a8e619a7f8648fca0b1ac576ef83cfe966 100644 (file)
@@ -1,4 +1,4 @@
-33d59eff1bd5de29f1fbde3b7625db28595835fd
+2b1a79c6395991fc4e60e20312ff44065fdb816b
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 77b4d52650751599007c6e8a8c38207e8e3619d9..52bec3dc6dd80725a3432e623ee3b62f3f1a2954 100644 (file)
@@ -7151,7 +7151,7 @@ Named_object::get_backend(Gogo* gogo, std::vector<Bexpression*>& const_decls,
         // still be returned by some function.  Simply calling the
         // type_descriptor method is enough to create the type
         // descriptor, even though we don't do anything with it.
-        if (this->package_ == NULL)
+        if (this->package_ == NULL && !saw_errors())
           {
             named_type->
                 type_descriptor_pointer(gogo, Linemap::predeclared_location());