Skip to content

Commit 546a783

Browse files
committed
[Attributor] Fix sanitizer for getAssumedMinTrailingZeros()
1 parent 52fdcf9 commit 546a783

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

llvm/include/llvm/Transforms/IPO/Attributor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5341,6 +5341,8 @@ struct AAPotentialConstantValues
53415341

53425342
/// Return the minimum trailing zeros of potential constants
53435343
unsigned getAssumedMinTrailingZeros() const {
5344+
if (!isValidState() || getAssumedSet().empty())
5345+
return 0;
53445346
unsigned TrailingZeros = getAssumedSet().begin()->getBitWidth() + 1;
53455347
for (const APInt &It : getAssumedSet()) {
53465348
if (It.countTrailingZeros() < TrailingZeros)

llvm/test/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def have_cxx_shared_library():
584584
print("could not exec llvm-readobj")
585585
return False
586586

587-
readobj_out = readobj_cmd.stdout.read().decode("ascii")
587+
readobj_out = readobj_cmd.stdout.read().decode("utf-8")
588588
readobj_cmd.wait()
589589

590590
regex = re.compile(r"(libc\+\+|libstdc\+\+|msvcp).*\.(so|dylib|dll)")

0 commit comments

Comments
 (0)