diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-08-12 17:21:11 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-08-12 17:21:11 +0000 |
commit | bb2978b8fd41165054ffe3cfcfa5311fffaf13cd (patch) | |
tree | cce35ab2a9a1547e0c06695e786896c6b35b2355 /gcc | |
parent | c3d3b30a9ab56e4bf2462bcdff76722ce5a3fa5e (diff) | |
download | gcc-bb2978b8fd41165054ffe3cfcfa5311fffaf13cd.zip gcc-bb2978b8fd41165054ffe3cfcfa5311fffaf13cd.tar.gz gcc-bb2978b8fd41165054ffe3cfcfa5311fffaf13cd.tar.bz2 |
compiler: Don't make gc symbol for bad array type.
When parsing a malformed array type, i.e. invalid length, gccgo
would loop indefinitely based off of a uninitialized length variable.
Fixes golang/go#11539.
Reviewed-on: https://go-review.googlesource.com/13066
From-SVN: r226825
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/types.cc | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 5046fbb..c9e6300 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -55175f7ee0db2c1e68423216d7744be80071ed6c +5fc38e74d132cd6f4e7b56e6bcf9fe57031ab203 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/types.cc b/gcc/go/gofrontend/types.cc index 7a7a103..5418313 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -6423,7 +6423,10 @@ Array_type::array_gc_symbol(Gogo* gogo, Expression_list** vals, unsigned long bound; if (!this->length_->numeric_constant_value(&nc) || nc.to_unsigned_long(&bound) == Numeric_constant::NC_UL_NOTINT) - go_assert(saw_errors()); + { + go_assert(saw_errors()); + return; + } Btype* pbtype = gogo->backend()->pointer_type(gogo->backend()->void_type()); int64_t pwidth = gogo->backend()->type_size(pbtype); |