diff options
author | zhangjian <zj.cosmos@gmail.com> | 2022-06-21 16:08:47 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2022-06-23 12:44:43 -0700 |
commit | 5ee8e1d1b0c0d9f6310d27a37a6162e0be80e413 (patch) | |
tree | 1c5a6d0e7944702aa1d602fabc77e57bae4176d3 /gcc | |
parent | 038a7150ec07770174907b93bc93caaa1e019f92 (diff) | |
download | gcc-5ee8e1d1b0c0d9f6310d27a37a6162e0be80e413.zip gcc-5ee8e1d1b0c0d9f6310d27a37a6162e0be80e413.tar.gz gcc-5ee8e1d1b0c0d9f6310d27a37a6162e0be80e413.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/export.cc | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 629bc66..f882812 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 a30b11a..7373dee 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) |