<html><head></head><body class="ApplePlainTextBody" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Watching all this work is very interesting. There was a PR about two casts from a float to int not showing up as the same symbolic value...wonder if this work here will fix it!<br><br>Two minor comments:<br><br>On Dec 7, 2011, at 6:12, Anna Zaks wrote:<br><br><blockquote type="cite">Modified: cfe/trunk/lib/StaticAnalyzer/Core/SValBuilder.cpp<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">DispatchCast:<br></blockquote><blockquote type="cite">-  // All other cases.<br></blockquote><blockquote type="cite">-  return isa<Loc>(val) ? evalCastFromLoc(cast<Loc>(val), castTy)<br></blockquote><blockquote type="cite">-                       : evalCastFromNonLoc(cast<NonLoc>(val), castTy);<br></blockquote><blockquote type="cite">+  // Check for casts from integers to integers.<br></blockquote><blockquote type="cite">+  if (castTy->isIntegerType() && originalTy->isIntegerType())<br></blockquote><blockquote type="cite">+    return dispatchCast(val, castTy);<br></blockquote><blockquote type="cite">+<br></blockquote><blockquote type="cite">+  return dispatchCast(val, castTy);<br></blockquote><br>Are both branches of this check supposed to be the same?<br><br><br><blockquote type="cite">Modified: cfe/trunk/lib/StaticAnalyzer/Core/Store.cpp<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">-  if (const Loc *L = dyn_cast<Loc>(&V))<br></blockquote><blockquote type="cite">-    return svalBuilder.evalCastFromLoc(*L, castTy);<br></blockquote><blockquote type="cite">-  else if (const NonLoc *NL = dyn_cast<NonLoc>(&V))<br></blockquote><blockquote type="cite">-    return svalBuilder.evalCastFromNonLoc(*NL, castTy);<br></blockquote><blockquote type="cite">-  <br></blockquote><blockquote type="cite">-  return V;<br></blockquote><blockquote type="cite">+  assert(isa<Loc>(&V) || isa<NonLoc>(&V));<br></blockquote><blockquote type="cite">+  return svalBuilder.dispatchCast(V, castTy);<br></blockquote><blockquote type="cite"><br></blockquote><br>Should this be assert(V->isDefined()), since this function no longer cares about the type of value? Even if we add some hypothetical third kind of defined SVal, dispatchCast should probably be taught to handle it.<br><br>Jordy</body></html>