Skip to content

Commit 34e1b2f

Browse files
bjopeZijunZhaoCCK
authored andcommitted
Revert "[analyzer] Fix crash analyzing _BitInt() in evalIntegralCast (llvm#65887)"
This reverts commit 4898c33. Lots of buildbots are failing, probably because lots of targets not supporting large _BitInt types.
1 parent 7ebad9f commit 34e1b2f

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

clang/lib/StaticAnalyzer/Core/SValBuilder.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,11 @@ SVal SValBuilder::evalIntegralCast(ProgramStateRef state, SVal val,
598598
APSIntType ToType(getContext().getTypeSize(castTy),
599599
castTy->isUnsignedIntegerType());
600600
llvm::APSInt ToTypeMax = ToType.getMaxValue();
601-
602-
NonLoc ToTypeMaxVal = makeIntVal(ToTypeMax);
603-
601+
NonLoc ToTypeMaxVal =
602+
makeIntVal(ToTypeMax.isUnsigned() ? ToTypeMax.getZExtValue()
603+
: ToTypeMax.getSExtValue(),
604+
castTy)
605+
.castAs<NonLoc>();
604606
// Check the range of the symbol being casted against the maximum value of the
605607
// target type.
606608
NonLoc FromVal = val.castAs<NonLoc>();

clang/test/Analysis/bitint-no-crash.c

-11
This file was deleted.

0 commit comments

Comments
 (0)