<p dir="ltr">Are you using a +asserts build? What kind of crash are you observing?</p>
<div class="gmail_quote">On Sep 12, 2013 6:42 AM, "Jesper Eskilson" <<a href="mailto:jesper.eskilson@iar.com">jesper.eskilson@iar.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi,<br>
<br>
I'm trying to figure out how I can obtain the value of an IntegerLiteral. I tried the following:<br>
<br>
const IntegerLiteral *lit = ...;<br>
if (lit != 0)<br>
{<br>
    int64_t n = lit->getValue().getSExtValue()<u></u>;<br>
    // do something with n<br>
}<br>
<br>
This seems to work sometimes, but frequently crashes. I've tried to figure out how to use the Evaluate*-functions in the Expr class, but I cannot figure out how they should be called.<br>
<br>
It's ok if obtaining the value sometimes fails, but it would be nice if it didn't crash. :)<br>
<br>
-- <br>
*Jesper Eskilson* /Development Engineer/<br>
IAR Systems AB<br>
Box 23051, Strandbodgatan 1<br>
SE-750 23 Uppsala, SWEDEN<br>
E-mail: <a href="mailto:jesper.eskilson@iar.com" target="_blank">jesper.eskilson@iar.com</a> <mailto:<a href="mailto:jesper.eskilson@iar.com" target="_blank">jesper.eskilson@iar.<u></u>com</a>> Website: <a href="http://www.iar.com" target="_blank">www.iar.com</a><br>

<<a href="http://www.iar.com" target="_blank">http://www.iar.com</a>> Twitter: <a href="http://www.twitter.com/iarsystems" target="_blank">www.twitter.com/iarsystems</a> <<a href="http://www.twitter.com/iarsystems" target="_blank">http://www.twitter.com/<u></u>iarsystems</a>><br>

______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
</blockquote></div>