[LLVMdev] Bug in ExecutionEngine::getConstantValue() -- Instruction::PtrToInt

Aaron Gray aaronngray.lists at googlemail.com
Sat Jul 25 11:17:18 PDT 2009

I think I might have found a bug in the exection engine's 'constants

Basically APInt's parameters are the wrong way round.

Line 577 for lib/ExecutionEngine/ExecutionEngine.cpp :-

    case Instruction::PtrToInt: {
      GenericValue GV = getConstantValue(Op0);
      uint32_t PtrWidth = TD->getPointerSizeInBits();
      GV.IntVal = APInt(PtrWidth, uintptr_t(GV.PointerVal));
      return GV;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090725/db18ac2e/attachment.html>

More information about the llvm-dev mailing list