<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 17, 2011, at 6:03 PM, Rob Nikander wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Mon, Jan 17, 2011 at 8:36 PM, Eric Christopher <<a href="mailto:echristo@apple.com">echristo@apple.com</a>> wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">   id testfunc(id a, id b) { ... }<br></blockquote><blockquote type="cite">   ...<br></blockquote><blockquote type="cite">   FunctionType *fn_type = FunctionType::get(id_type, argtypes, false);<br></blockquote><blockquote type="cite">   Value *fn = ConstantExpr::getIntToPtr(ConstantInt::get(int64_type,<br></blockquote><blockquote type="cite">reinterpret_cast<int64_t>(testfunc)), fn_type);<br></blockquote><blockquote type="cite">   return builder.CreateCall2(fn, arg0val, arg1val);   // <--<br></blockquote><blockquote type="cite">assertion fails here<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">What am I doing wrong?  I can paste more code if needed.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">One of the types doesn't match the types of what you are trying to pass.<br></blockquote><blockquote type="cite">You should debug which one it is and why the types aren't matching what<br></blockquote><blockquote type="cite">you think they should be.<br></blockquote><br>Okay, found it.  My function was of type: "i8* (i8*, i8*)".  I thought<br>that was okay, but now I see it needed to be "i8* (i8*, i8*)*" -- ie,<br>a pointer to the former type.<br></div></blockquote></div><br><div>Ah. excellent.</div><div><br></div><div>-eric</div></body></html>