<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" id="owaParaStyle" style="display: none;">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body dir="ltr" fpstyle="1" aria-label="Message body" tabindex="0">
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; color: #000000; margin: 0">
<p>Dear All</p>
<p>I'm trying to create storeInst using </p>
<p>StoreInst *SI = new StoreInst(val, AI, BB);</p>
<p>AI is an alloca instruction previously created, BB is the basicBlock I want to put instructionsi in. Val is the value to store.</p>
<p>I've created val from a genericValue like this:</p>
<p>Value* val = ConstantInt::get(getGlobalContext(), Result.IntVal);</p>
<div>
<p>Result is the genericValue</p>
<p>However I keep getting this error:</p>
<p>void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.</p>
<p><br>
</p>
<p>What is wrong about my code?</p>
<p><br>
</p>
<p>Thanks a million in advance.</p>
<p><br>
</p>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">Regards,<br>
Marwa Yusuf<br>
Teaching Assistant - Computer Engineering Department<br>
Faculty of Engineering - Benha University<br>
E-JUST MSc Student<br>
Computer Science & Engineering Dept.</div>
</span></font></div>
</div>
</div>
</body>
</html>