summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2019-08-06 00:21:30 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2019-08-06 00:21:30 +0000
commitf0380bac5f751c28d429d96c8fac955c448093de (patch)
treec262aeab550d445b570df119c158cc1ef98e3eff
parent15e468e0d5b7c7ac64a387513c9c9115d8875ef8 (diff)
downloadbcm5719-llvm-f0380bac5f751c28d429d96c8fac955c448093de.tar.gz
bcm5719-llvm-f0380bac5f751c28d429d96c8fac955c448093de.zip
Silence ubsan after r367926.
Fixes e.g. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/14273 We can't left shift here because left shifting of a negative number is UB. The same doesn't apply to unsigned arithmetic, but switching to unsigned doesn't appear to stop ubsan from complaining, so we need to mask out the high bits. llvm-svn: 367959
-rw-r--r--llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
index 03c5c6b8e10..d6596ea3926 100644
--- a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
@@ -178,6 +178,7 @@ std::error_code SymbolizableObjectFile::addSymbol(const SymbolRef &Symbol,
if (UntagAddresses) {
// For kernel addresses, bits 56-63 need to be set, so we sign extend bit 55
// into bits 56-63 instead of masking them out.
+ SymbolAddress &= (1ull << 56) - 1;
SymbolAddress = (int64_t(SymbolAddress) << 8) >> 8;
}
if (OpdExtractor) {
OpenPOWER on IntegriCloud