diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-12-15 23:44:13 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-12-15 23:44:13 +0000 |
commit | 63ba3ad3edb8d854e03a5d684636d2ee90dc9b05 (patch) | |
tree | aabc663b0ef6421ac37e7f6488b5d000baf593f0 | |
parent | 62afb87d9c466ab33767fad6d74133a4ad925f52 (diff) | |
download | gcc-63ba3ad3edb8d854e03a5d684636d2ee90dc9b05.zip gcc-63ba3ad3edb8d854e03a5d684636d2ee90dc9b05.tar.gz gcc-63ba3ad3edb8d854e03a5d684636d2ee90dc9b05.tar.bz2 |
compiler: fix off-by-1 array type len in Type::gc_symbol_constructor
Array type being built to hold GC var initializer was being created
with an extra/unneeded slot. Fix up the code to insure that the array
length matches the length of the initializer list.
Reviewed-on: https://go-review.googlesource.com/34413
From-SVN: r243731
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/types.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 4a5f6d2..8f64fdf 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -e807c1deec1e7114bc4757b6193510fdae13e75f +ae57b28b3caf1f6670e0f663235f1bf7655db870 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 f3cb32b..eab3bed 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -2261,7 +2261,7 @@ Type::gc_symbol_constructor(Gogo* gogo) vals->push_back(Expression::make_integer_ul(GC_END, uintptr_t, bloc)); - Expression* len = Expression::make_integer_ul(vals->size() + 1, NULL, + Expression* len = Expression::make_integer_ul(vals->size(), NULL, bloc); Array_type* gc_symbol_type = Type::make_array_type(uintptr_t, len); return Expression::make_array_composite_literal(gc_symbol_type, vals, bloc); |