-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler: correct condition for calling memclrHasPointers
Without this patch it's impossible to use `gccgo` in bootstrapping Go.
- Loading branch information
Showing
6 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
gcc10-compiler-correct-condition-for-calling-memclrHasPoin.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Ian Lance Taylor <[email protected]> | ||
Date: Sat, 21 Aug 2021 12:42:19 -0700 | ||
Subject: [PATCH] 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 | ||
|
||
--- | ||
gcc/go/gofrontend/MERGE | 2 +- | ||
gcc/go/gofrontend/expressions.cc | 2 +- | ||
2 files changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE | ||
index e425f15..ff41af7 100644 | ||
--- a/gcc/go/gofrontend/MERGE | ||
+++ b/gcc/go/gofrontend/MERGE | ||
@@ -1,4 +1,4 @@ | ||
-823c91088bc6ac606362fc34b2880ce0de1624ad | ||
+21b30eddc59d92a07264c3b21eb032d6c303d16f | ||
|
||
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/expressions.cc b/gcc/go/gofrontend/expressions.cc | ||
index 8f59b18..f27375d 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 |