balazske added a comment.

If the original memory object is not known the static size is not known too. 
Every pointer with unknown source can point into a bigger data structure.



================
Comment at: clang/test/Analysis/return-ptr-range.cpp:11
+int *test_global_ptr() {
+  do { // expected-note{{Loop condition is false.  Exiting loop}}
     int x = conjure_index();
----------------
steakhal wrote:
> I would rather use a simple block `{...}` for opening a scope, but I don't 
> know why you don't declare `ptr` in the original scope in the first place.
> People usually use `do {} while(0)` constructs if they want to use `break` 
> somewhere ~~ like a `goto` OR they implement a macro. You are doing none of 
> these.
I do not know why these loops are here but did not change the original code. 
Should we change it to simple block?


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