aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/MicrosoftMangle.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp
index 6918ce4826..c2811fb8ab 100644
--- a/lib/AST/MicrosoftMangle.cpp
+++ b/lib/AST/MicrosoftMangle.cpp
@@ -317,10 +317,11 @@ void MicrosoftCXXNameMangler::mangleNumber(const llvm::APSInt &Value) {
char Encoding[64];
char *EndPtr = Encoding+sizeof(Encoding);
char *CurPtr = EndPtr;
- llvm::APSInt Fifteen(Value.getBitWidth(), 15);
+ llvm::APSInt NibbleMask(Value.getBitWidth());
+ NibbleMask = 0xf;
for (int i = 0, e = Value.getActiveBits() / 4; i != e; ++i) {
- *--CurPtr = 'A' + Value.And(Fifteen).lshr(i*4).getLimitedValue(15);
- Fifteen = Fifteen.shl(4);
+ *--CurPtr = 'A' + Value.And(NibbleMask).lshr(i*4).getLimitedValue(0xf);
+ NibbleMask = NibbleMask.shl(4);
};
Out.write(CurPtr, EndPtr-CurPtr);
Out << '@';