<div dir="ltr">Hello everyone,<div><br></div><div>Recently I am using the Clang Static Analyzer in my research work, and basically writing my own checker. However I come across a problem on the type conversion. </div><div><br></div><div>I wanted to convert <i>SVal</i> type to <i>SymbolRef</i> type or <i>SymExpr</i> type in some callback function, and I tried several methods, like:</div><div>







<p class=""><span class="">const SymExpr* symexpr = Sval.getAsSymExpr()</span></p></div><div>







<p class=""><span class="">const SymbolRef symbolref = Sval.getAsSymbol()</span></p><p class=""><span class="">







</span></p><p class=""><span class="">const SymExpr* symexpr2 = Sval.getAsSymbolicExpression()</span></p><p class=""><span class="">







</span></p><p class=""><span class="">const SymbolRef symbolref2 = Sval.getAsLocSymbol()</span></p></div><div> but none of them worked, and all I got was a NULL pointer.</div><div><br></div><div>Do I made any mistake when using them? or should these functions be used under some special situation? Actually the value of SVal can be dumped to print, but I just can not make these conversions.</div><div><br></div><div>Need your help and looking forward for your reply, thank you!</div><div><br></div><div><br></div><div>Kind regards</div><div>Pengfei</div>







</div>