From 074a16f84466940a34e13c1469403610f2004efb Mon Sep 17 00:00:00 2001 From: "Dongjia \"toka\" Zhang" Date: Tue, 16 Jul 2024 13:04:24 +0200 Subject: [PATCH] Fix autotokens (#2407) --- libafl_cc/src/autotokens-pass.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libafl_cc/src/autotokens-pass.cc b/libafl_cc/src/autotokens-pass.cc index af0b094144..74224c0271 100644 --- a/libafl_cc/src/autotokens-pass.cc +++ b/libafl_cc/src/autotokens-pass.cc @@ -498,6 +498,11 @@ bool AutoTokensPass::runOnModule(Module &M) { Value *op2 = callInst->getArgOperand(2); ConstantInt *ilen = dyn_cast(op2); + if (!ilen) { + op2 = callInst->getArgOperand(1); + ilen = dyn_cast(op2); + } + if (ilen) { uint64_t literalLength = optLen; optLen = ilen->getZExtValue();