Fix autotokens (#2407)

This commit is contained in:
Dongjia "toka" Zhang 2024-07-16 13:04:24 +02:00 committed by GitHub
parent 4370a84bd2
commit 074a16f844
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -498,6 +498,11 @@ bool AutoTokensPass::runOnModule(Module &M) {
Value *op2 = callInst->getArgOperand(2); Value *op2 = callInst->getArgOperand(2);
ConstantInt *ilen = dyn_cast<ConstantInt>(op2); ConstantInt *ilen = dyn_cast<ConstantInt>(op2);
if (!ilen) {
op2 = callInst->getArgOperand(1);
ilen = dyn_cast<ConstantInt>(op2);
}
if (ilen) { if (ilen) {
uint64_t literalLength = optLen; uint64_t literalLength = optLen;
optLen = ilen->getZExtValue(); optLen = ilen->getZExtValue();