diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-08-31 02:56:55 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-08-31 02:56:55 +0000 |
commit | e7c8f75569e792f81a4f4ceee4e1b20f2544e7a4 (patch) | |
tree | 8df5d7cc13e2da84e81cf635d1c6596651a9dae8 /gcc | |
parent | d24c41ef1a44b72aaf03edc6eb40cae711b27f95 (diff) | |
download | gcc-e7c8f75569e792f81a4f4ceee4e1b20f2544e7a4.zip gcc-e7c8f75569e792f81a4f4ceee4e1b20f2544e7a4.tar.gz gcc-e7c8f75569e792f81a4f4ceee4e1b20f2544e7a4.tar.bz2 |
compiler: don't report runtime escapes if we've seen errors
If we get errors during compilation, we skip the escape analysis pass.
If we are compiling the runtime package, we report an error if a bound
method expression escapes. The effect is that if we get an error
while compiling the runtime package, we would report confusing and
meaningless errors about bound method expressions escaping.
This CL stops doing that.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192720
From-SVN: r275238
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index c8605ec..888e96d 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -2444eb1e8c697531f8beb403679e4ab00b16dbf5 +80403eb9e95c9642ebabb4d7c43deedaa763211f The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 939a5f7..4db4e4a 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -7948,7 +7948,9 @@ Bound_method_expression::do_flatten(Gogo* gogo, Named_object*, Node* n = Node::make_node(this); if ((n->encoding() & ESCAPE_MASK) == Node::ESCAPE_NONE) ret->heap_expression()->set_allocate_on_stack(); - else if (gogo->compiling_runtime() && gogo->package_name() == "runtime") + else if (gogo->compiling_runtime() + && gogo->package_name() == "runtime" + && !saw_errors()) go_error_at(loc, "%s escapes to heap, not allowed in runtime", n->ast_format(gogo).c_str()); |