diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-08-21 12:42:19 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-09-10 11:14:06 -0700 |
commit | b7f84702b364d49824ca97d4a2fc01567301d784 (patch) | |
tree | d3d0809da1b2361e41cdd8697190beb9b8b72802 /gcc | |
parent | 01b5038718056b024b370b74a874fbd92c5bbab3 (diff) | |
download | gcc-b7f84702b364d49824ca97d4a2fc01567301d784.zip gcc-b7f84702b364d49824ca97d4a2fc01567301d784.tar.gz gcc-b7f84702b364d49824ca97d4a2fc01567301d784.tar.bz2 |
compiler: correct condition for calling memclrHasPointers
When compiling append(s, make([]typ, ln)...), where typ has a pointer,
and the append fits within the existing capacity of s, the condition
used to clear out the new elements was reversed.
Fixes golang/go#47771
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/344189
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 c377269..ff41af7 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -e42c7c0216aec70834e8827174458aa4a50169fa +21b30eddc59d92a07264c3b21eb032d6c303d16f 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 8d4d168..ddb1d91 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -9350,7 +9350,7 @@ Builtin_call_expression::flatten_append(Gogo* gogo, Named_object* function, ref2 = Expression::make_cast(uint_type, ref2, loc); cond = Expression::make_binary(OPERATOR_GT, ref, ref2, loc); zero = Expression::make_integer_ul(0, int_type, loc); - call = Expression::make_conditional(cond, call, zero, loc); + call = Expression::make_conditional(cond, zero, call, loc); } } else |