<div>I think I might have found a bug in the exection engine's 'constants folding'.</div>
<div> </div>
<div>Basically APInt's parameters are the wrong way round.</div>
<div> </div>
<div>Line 577 for lib/ExecutionEngine/ExecutionEngine.cpp :-</div>
<div> </div>
<div><font face="courier new,monospace">    case Instruction::PtrToInt: {<br>      GenericValue GV = getConstantValue(Op0);<br>      uint32_t PtrWidth = TD->getPointerSizeInBits();<br>      GV.IntVal = APInt(PtrWidth, uintptr_t(GV.PointerVal));<br>

      return GV;<br>    }<br></font></div>
<div><font face="courier new,monospace">Aaron</font></div>
<div><font face="courier new,monospace"> </font></div>