<div dir="ltr"><div dir="ltr">Hi!</div><div><br></div><div>Adding Artem as he already did some heroic work hunting down liveness bugs. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 22, 2020 at 6:38 AM Balázs Kéri via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div>void test() {<br></div><div>  int ret = (function() != 0);<br></div><div>  if (ret == 0) { }</div><div>}</div></div></div></div></div></div></blockquote><div><br></div><div><div><br></div><div>There are actually two possible scenarios that can happen for a code like that.</div><div><br></div><div>1. We conjure a symbol for function, and build a symbolic expression from the initialization expression and bind this symbolic expression to ret. In this case the symbol returned by the function is still in use, it will not be garbage collected.</div></div><div>2. We conjure a symbol for the function but for some reason we cannot build a symbolic expression from the initialization expression (either something is not representable using the current implementation, or we explicitly chose not to represent the expression due to solver limitations or performance tradeoffs). In this case we will conjure a new symbol for ret and since we never ever mention the symbol returned by the function anywhere it can be garbage collected.</div><div><br></div><div>While this behavior might be annoying, given the current limitations of the constraint solver, you might not be able to leverage the information even if the symbol wasn't garbage collected in the first place.  But in case you want to experiment a bit, you can always subscribe to checkLiveSymbols callback and keep the symbols alive artificially to see if you can get something useful out of them. For the cases where you can we might want to change the behavior.</div><div><br></div><div>Cheers,</div><div>Gabor</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div></div><div><br></div></div></div></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>