<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Aaron Gray wrote:
<blockquote
cite="mid:9719867c0907251117m1e6f34a9n847da0a802cbb05f@mail.gmail.com"
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>
}<br>
</font></div>
<div><font face="courier new,monospace">Aaron</font></div>
</blockquote>
That looks to be the right order to me:<br>
<br>
APInt(unsigned numBits, uint64_t val, bool isSigned=false)<br>
<br>
John.
</body>
</html>