[PATCH] D45416: [analyzer] ExprEngine: model GCC inline asm rvalue cast outputs

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 9 11:16:09 PDT 2018


a.sidorin added inline comments.


================
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:3082
+    if (X.isUnknown()) {
+      // The value being casted to rvalue can be garbage-collected after
+      // the cast is modeled. Try to recover the memory region being casted
----------------
george.karpenkov wrote:
> From my understanding, the code inside the if-block is not tested below
> 
It is tested: without this code, "TRUE" will be printed. The reason is that the lvalue of 'global' is removed from Environment after the cast happens so `X` becomes Unknown.  But the way of retrieving the value is definitely not the best so if you have any suggestions on improvement - they are welcome.


Repository:
  rC Clang

https://reviews.llvm.org/D45416





More information about the cfe-commits mailing list