steakhal accepted this revision.
steakhal added inline comments.

================
Comment at: clang/test/Analysis/return-ptr-range.cpp:17
       return arr; // no-warning
-  } while (0);
-  return ptr; // expected-warning{{Returned pointer value points outside the 
original object (potential buffer overflow)}}
+  }
+  return ptr; // expected-warning{{Returned pointer value points outside the 
original object (potential buffer overflow) [alpha.security.ReturnPtrRange]}}
----------------
balazske wrote:
> steakhal wrote:
> > I don't think we need this extra scope. Same for the others.
> The original test was used to make the `x` "dead" at return after the loop 
> (at least without the fix), see D12726. In the case of loop the `x` is 
> garbage-collected at end of the loop, if a block is used only at the end of 
> the function (?) but not at end of the block. So I want to put back the loop 
> to preserve the original code.
Thank you for letting me know.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107051/new/

https://reviews.llvm.org/D107051

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to