Skip to content

Commit

Permalink
Revert "[analyzer] Fix crash analyzing _BitInt() in evalIntegralCast (#…
Browse files Browse the repository at this point in the history
…65887)"

This reverts commit 4898c33.

Lots of buildbots are failing, probably because lots of targets not supporting
large _BitInt types.
  • Loading branch information
bjope committed Sep 18, 2023
1 parent 014c41d commit 929662b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
8 changes: 5 additions & 3 deletions clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,11 @@ SVal SValBuilder::evalIntegralCast(ProgramStateRef state, SVal val,
APSIntType ToType(getContext().getTypeSize(castTy),
castTy->isUnsignedIntegerType());
llvm::APSInt ToTypeMax = ToType.getMaxValue();

NonLoc ToTypeMaxVal = makeIntVal(ToTypeMax);

NonLoc ToTypeMaxVal =
makeIntVal(ToTypeMax.isUnsigned() ? ToTypeMax.getZExtValue()
: ToTypeMax.getSExtValue(),
castTy)
.castAs<NonLoc>();
// Check the range of the symbol being casted against the maximum value of the
// target type.
NonLoc FromVal = val.castAs<NonLoc>();
Expand Down
11 changes: 0 additions & 11 deletions clang/test/Analysis/bitint-no-crash.c

This file was deleted.

0 comments on commit 929662b

Please sign in to comment.