We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cacf4e commit 86dea5aCopy full SHA for 86dea5a
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -823,10 +823,9 @@ void ModuleSanitizerCoverage::InjectTraceForSwitch(
823
Int64Ty->getScalarSizeInBits())
824
Cond = IRB.CreateIntCast(Cond, Int64Ty, false);
825
for (auto It : SI->cases()) {
826
- Constant *C = It.getCaseValue();
827
- if (C->getType()->getScalarSizeInBits() <
828
- Int64Ty->getScalarSizeInBits())
829
- C = ConstantExpr::getCast(CastInst::ZExt, It.getCaseValue(), Int64Ty);
+ ConstantInt *C = It.getCaseValue();
+ if (C->getType()->getScalarSizeInBits() < 64)
+ C = ConstantInt::get(C->getContext(), C->getValue().zext(64));
830
Initializers.push_back(C);
831
}
832
llvm::sort(drop_begin(Initializers, 2),
0 commit comments