Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: src/IceGlobalContext.cpp

Issue 390533002: Subzero: Fix the name mangling code's base-36 increment. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/mangle.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.cpp
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index 50ac5bd80adde1c3c0ae726b20a483bc8de0d13f..a7b1b64c2951f8780f7ad8304129539109f136e4 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -166,9 +166,10 @@ void GlobalContext::incrementSubstitutions(ManglerVector &OldName) const {
assert(OldName[OldPos - 1] == 'S');
assert(OldName[OldPos + Length] == '_');
if (AllZs) {
- // Replace N 'Z' characters with N+1 '0' characters. (This
- // is also true for N=0, i.e. S_ ==> S0_ .)
- for (size_t i = 0; i < Length + 1; ++i) {
+ // Replace N 'Z' characters with a '0' (if N=0) or '1' (if
+ // N>0) followed by N '0' characters.
+ NewName[NewPos++] = (Length ? '1' : '0');
+ for (size_t i = 0; i < Length; ++i) {
NewName[NewPos++] = '0';
}
} else {
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/mangle.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698