public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-10105] compiler: correct condition for calling memclrHasPointers
@ 2021-09-10 18:15 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2021-09-10 18:15 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:503dccc6be7c86e1fae667d856eed939448947d3

commit r10-10105-g503dccc6be7c86e1fae667d856eed939448947d3
Author: Ian Lance Taylor <iant@golang.org>
Date:   Fri Sep 10 11:15:07 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 8f59b18d47f..f27375d52a6 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -9075,7 +9075,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:15 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:15 [gcc r10-10105] 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).