diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-08-09 21:24:00 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-08-09 21:24:00 +0000 |
commit | 19eec7ac5f73e7fc9eee97438bd5cbdcd07072c2 (patch) | |
tree | 4a33dc3570b0216cf7209e5e31a7f9bdb1f8a647 /gcc | |
parent | cc6a467f450424a14bfc71d03e83b3981f4fc864 (diff) | |
download | gcc-19eec7ac5f73e7fc9eee97438bd5cbdcd07072c2.zip gcc-19eec7ac5f73e7fc9eee97438bd5cbdcd07072c2.tar.gz gcc-19eec7ac5f73e7fc9eee97438bd5cbdcd07072c2.tar.bz2 |
compiler: fix buglet in lshift type determination
It's possible to construct an lshift expression using unsafe.Sizeof
that is technically a compile-time constant but can't be evaluated
without going through backend methods. In this case, insure that
Type::make_non_abstract_type is called on the numeric operand of the
shift (as opposed to leaving as abstract), to avoid an assert later on
in the compiler flow.
Fixes golang/go#21372.
Reviewed-on: https://go-review.googlesource.com/54370
From-SVN: r251006
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 4fe569c..c5ecb10 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -5fd112e5c2968e94761c41519c451d789e23a92b +480fdfa9dd416bd17115a94fa6021c4dd805fc39 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 eb23ec2..6f9c1c9 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -5655,7 +5655,7 @@ Binary_expression::do_determine_type(const Type_context* context) Type_context subcontext(*context); - if (is_constant_expr) + if (is_constant_expr && !is_shift_op) { subcontext.type = NULL; subcontext.may_be_abstract = true; |