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
-55175f7ee0db2c1e68423216d7744be80071ed6c
+5fc38e74d132cd6f4e7b56e6bcf9fe57031ab203
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
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);