[cfe-dev] [analyzer] How to detect a block inside which SVal is used?

Denis Petrov via cfe-dev cfe-dev at lists.llvm.org
Mon Jul 20 08:28:05 PDT 2020


 How to detect a block inside which SVal is used in a path-sensitive way?


E.g.

void foo(int x) // Here `x` has a Symbolic representation (e.g. reg_$0<int x>)
{
  // block 1
  {
    int y = x; // Here I want to know that `x` is used inside a simple block
  }

  // block 2
  if(){
    int y = x; ? // Here I want to know that `x` is used inside if-true-block
  }

  // block 3
  while(){
    int y = x; // Here ?I want to know that `x` is used inside while-loop-body
  }
}

?I'm fighting with this sereval days. Insensitive way (checkASTCodeBody) is quite poor and not the case.

?Thanks.



________________________________
Denys Petrov
Senior ะก++ Developer | Kharkiv, Ukraine

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200720/b17cc2fc/attachment.html>


More information about the cfe-dev mailing list