]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: in Sort_bindings return false if comparing value to itself
authorzhangjian <zj.cosmos@gmail.com>
Tue, 21 Jun 2022 16:08:47 +0000 (16:08 +0000)
committerIan Lance Taylor <iant@golang.org>
Thu, 23 Jun 2022 19:44:43 +0000 (12:44 -0700)
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

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/export.cc

index 629bc666dc0907ab57f12c8e7c1350c92bb59f4c..f882812d219b1fbd89ef8190b5a66641d7e65ca4 100644 (file)
@@ -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.
index a30b11af31e4647c3c8460963ba6f23bc2c7c32e..7373deee310b0bd9029f3b2271ec0847e9993f2e 100644 (file)
@@ -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)