NoQ added a comment.

No, please don't do this.

The checker should *always* know the nature of the object in advance. If you 
look at the SVal in order to figure out the nature of the object, you are 
unable to discriminate between objects of completely different nature that are 
intentionally represented by the same SVal. For example, if you receive a 
SymbolicRegion value as a return value from your `getReturnObject()`, this can 
be for two reasons: (1) you're returning a pointer, (2) you're returning an 
object into that region. And you can't discriminate between those cases by 
looking at the SVal.

Both arbitrary glvalues and pointer prvalues are represented by Loc values but 
any code that fails to discriminate between the value of expression E and the 
value of ImplicitCastExpr(E, CK_LValueToRValue) is bonkers.

See also D77062#inline-744287 <https://reviews.llvm.org/D77062#inline-744287>


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81718



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

Reply via email to