<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Dec 2, 2013, at 6:42 PM, marc chellarmani <<a href="mailto:marcchellarmani@email.biz">marcchellarmani@email.biz</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,</div><div><br></div><div>I have the following instruction in my IR-</div><div><b>%call2 = call i8* @strcpy(i8* %1, i8* %2)</b> #2</div><div><br></div><div>I intend to change call to strcpy with strncpy. I have included the following code in runOnFunction, so that when it is strcpy's turn to be invoked, strncpy is invoked instead.</div><div><br></div><div>Assuming I* is the strcpy instruction,</div><div><br></div><div><b>CallInst* x=new CallInst::CreateCall3(strncpy,1,2,ConstantInt(16),"my_strncpy");</b></div><div><b>ReplaceInstWithInst(I*,x);</b></div><div><br></div><div>I'm running into a whole bunch of errors in CreateCall3(). How can I go about writing this correctly?</div><div><br></div></blockquote>You’re using ‘new’ incorrectly. The ‘CreateCall3’ does all of the allocation and creation of the call instruction.</div><div><br></div><div>-bw</div><div><br></div><br></body></html>