<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 25, 2009, at 11:17 AM, Aaron Gray wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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> }</font></div></blockquote>The code matches:</div><div><br></div><div><div> APInt(unsigned numBits, uint64_t val, bool isSigned = false)</div><div><br></div><div>which is correct.</div><div><br></div><div>-Chris</div></div></body></html>