aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-12-05 02:03:19 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-12-05 02:03:19 +0000
commitae4bb13f0d8bd4d630a47f04ff5b7e60274a0a9b (patch)
treeba65137f4135af4de247ed5675b47fd1cac1136a /gcc/go
parent141abc6f1e5a6a2de0a1ee97b63d56ee50b85a66 (diff)
downloadgcc-ae4bb13f0d8bd4d630a47f04ff5b7e60274a0a9b.zip
gcc-ae4bb13f0d8bd4d630a47f04ff5b7e60274a0a9b.tar.gz
gcc-ae4bb13f0d8bd4d630a47f04ff5b7e60274a0a9b.tar.bz2
compiler: no nil check needed for closure var dereferences
Add the "no nil check needed" annotation to the dereference operations created in Parse::enclosing_var_reference (this is safe since the closure object is under control of the compiler, and pointer fields in it will always be non-nil). Reviewed-on: https://go-review.googlesource.com/81795 From-SVN: r255400
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/parse.cc5
2 files changed, 4 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index ecb38ee..e0d606c 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-338f7434175bb71f3c8905e9ad7f480aec3afee6
+297cf346f2400274946650ab9ecd039427fc986b
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/parse.cc b/gcc/go/gofrontend/parse.cc
index be6f3f1..98f3067 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -2747,7 +2747,7 @@ Parse::enclosing_var_reference(Named_object* in_function, Named_object* var,
location);
closure_ref =
Expression::make_dereference(closure_ref,
- Expression::NIL_CHECK_DEFAULT,
+ Expression::NIL_CHECK_NOT_NEEDED,
location);
// The closure structure holds pointers to the variables, so we need
@@ -2755,7 +2755,8 @@ Parse::enclosing_var_reference(Named_object* in_function, Named_object* var,
Expression* e = Expression::make_field_reference(closure_ref,
ins.first->index(),
location);
- e = Expression::make_dereference(e, Expression::NIL_CHECK_DEFAULT, location);
+ e = Expression::make_dereference(e, Expression::NIL_CHECK_NOT_NEEDED,
+ location);
return Expression::make_enclosing_var_reference(e, var, location);
}