<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 22, 2014 at 5:23 AM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">================<br>
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:54-56<br>
@@ -53,1 +53,5 @@<br>
<br>
+REGISTER_TRAIT_WITH_PROGRAMSTATE(<br>
+    InitializedTemporariesSet,<br>
+    llvm::ImmutableSet<const CXXBindTemporaryExpr *>);<br>
+<br>
----------------<br>
</div><div class="">Manuel Klimek wrote:<br>
> Jordan Rose wrote:<br>
> > This needs to include the current StackFrameContext as well (for recursive functions). You can get that from the current LocationContext.<br>
> Can you elaborate on how I would put that into a datastructure? Just use a std::pair? (doesn't seem to work with ImmutableSet though)<br>
><br>
> Also, I seem unable to write a test that breaks because of this - any hints would be highly welcome.<br>
</div>We'd have to write a specialization of ImutProfileInfo for std::pair, but that's probably not a bad idea anyway. Please feel free to add one to ImmutableSet.h.<br>
<br>
I would guess the test case would look something like this:<br>
<br>
  static bool test(bool isInner) {<br>
    if (isInner || NoReturnDtor() || test(true)) {<br></blockquote><div><br></div><div>Putting the recursive call into the condition, of course :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

      *(volatile int *)0 = 1; // should warn<br></blockquote><div><br></div><div>The analyzer now presents a puzzle:</div><div>Your test works (does not warn currently, warns when I add the stack-frame info).</div><div>The problem is that when I replace that line with:</div>
<div>clang_analyzer_eval(true); // expected-warning{{TRUE}}</div><div>I do not get that warning.</div><div><br></div><div>What's the difference?</div><div><br></div><div>Thanks!</div><div>/Manuel</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

    }<br>
  }<br>
  void topLevel() {<br>
    test(false);<br>
  }<br>
<br>
<a href="http://reviews.llvm.org/D3627" target="_blank">http://reviews.llvm.org/D3627</a><br>
<br>
<br>
</blockquote></div><br></div></div>