public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1223] compiler: in Sort_bindings return false if comparing value to itself
@ 2022-06-23 19:45 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2022-06-23 19:45 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5ee8e1d1b0c0d9f6310d27a37a6162e0be80e413

commit r13-1223-g5ee8e1d1b0c0d9f6310d27a37a6162e0be80e413
Author: zhangjian <zj.cosmos@gmail.com>
Date:   Tue Jun 21 16:08:47 2022 +0000

    compiler: in Sort_bindings return false if comparing value to itself
    
    Some versions of std::sort may pass elements at the same iterator location.
    
    Fixes golang/go#53483
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413434

Diff:
---
 gcc/go/gofrontend/MERGE     | 2 +-
 gcc/go/gofrontend/export.cc | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 629bc666dc0..f882812d219 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-6c3752315dc9b82d0f3f3ac646a1e7376818f84a
+6b314f7947b4b31a86c09d166fe6664cd9968824
 
 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/export.cc b/gcc/go/gofrontend/export.cc
index a30b11af31e..7373deee310 100644
--- a/gcc/go/gofrontend/export.cc
+++ b/gcc/go/gofrontend/export.cc
@@ -530,6 +530,9 @@ struct Sort_bindings
   bool
   operator()(const Named_object* n1, const Named_object* n2) const
   {
+    if (n1 == n2)
+      return false;
+
     if (n1->package() != n2->package())
       {
 	if (n1->package() == NULL)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-23 19:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 19:45 [gcc r13-1223] compiler: in Sort_bindings return false if comparing value to itself 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).