public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-8977] compiler: correct condition for calling memclrHasPointers
@ 2021-09-10 18:14 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2021-09-10 18:14 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:7edb992d8195572e2c823fedab319eb6cb2f0f32
commit r11-8977-g7edb992d8195572e2c823fedab319eb6cb2f0f32
Author: Ian Lance Taylor <iant@golang.org>
Date: Fri Sep 10 11:14:25 2021 -0700
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
Diff:
---
gcc/go/gofrontend/expressions.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 6375922dac1..de8399f8231 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -9169,7 +9169,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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-10 18:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 18:14 [gcc r11-8977] compiler: correct condition for calling memclrHasPointers Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).