<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body>
<br><p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><span style="font-family: ".SFUIText"; font-size: 16pt;"></span><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">Hi All,</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><span style="font-family: ".SFUIText"; font-size: 16pt;"></span><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">I need a support to find the below *IL  null pointer return for negative</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">integer numbers.</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><span style="font-family: ".SFUIText"; font-size: 16pt;"></span> </p><p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;">Checker code:</p><p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">const Expr *e = vDecl->getInit();</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">auto *IL = dyn_cast<IntegerLiteral>(e);</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><span style="font-family: ".SFUIText"; font-size: 16pt;"></span><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">if(IL !=NULL)</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">{</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">    double val = IL->getValue().signedRoundToDouble();</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">    cout << "val:" val;</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">}</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><span style="font-family: ".SFUIText"; font-size: 16pt;"></span><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">test function:</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><span style="font-family: ".SFUIText"; font-size: 16pt;"></span><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">main()</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">{</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">    int val = 100;  (int val = -100;)</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">    printf("%d", val);</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">}</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><span style="font-family: ".SFUIText"; font-size: 16pt;"></span><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><span style="font-family: ".SFUIText"; font-size: 16pt;"></span><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">if the local variable is positive ex: int var 100;  then cout prints the</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">right value "100".</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">But if the local variable is negative ex: int var -100;  then IL becomes</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">NULL and cout is not executed.</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><span style="font-family: ".SFUIText"; font-size: 16pt;"></span><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">Please help me root cause this issue.</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><span style="font-family: ".SFUIText"; font-size: 16pt;"></span><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">Thanks,</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><span style="font-family: ".SFUIText"; font-size: 16pt;">Devendran.</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69); min-height: 19.1px;"><span style="font-family: ".SFUIText"; font-size: 16pt;"></span><br></p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: ".SF UI Text"; color: rgb(69, 69, 69);"><br></p><br><a href="https://overview.mail.yahoo.com/?.src=iOS">Sent from Yahoo Mail for iPad</a><br>
</body></html>