-1

Is there a simple way to take the general arguments of a function (Pointer, Array, Integer) and get the values backing the expression, when writing a custom checker? As in, I match against a function such as:

Pointer p;

Integer i;

CallSite f("func");

if(MATCH( f(p,i) ))
   //get function arguments

Is there a simple way of getting the values backing p and i? Thanks.

**Language is C++ to make a custom checker

Andy Hayden
  • 359,921
  • 101
  • 625
  • 535
Batman
  • 49
  • 1
  • 8
  • Please add the language which you are using. – RRUZ Dec 09 '11 at 00:19
  • Coverity SDK the poster is referring to, at least in the current version, only supports C/C++ analysis, so the language is (subtly) implicit in the question. – Asya Kamsky Dec 09 '11 at 19:44

1 Answers1

1

There is no way to get run-time value from these variables statically.

Maybe it's more accurate to say that this is beyond the scope of what a simple static analysis checker can do.

The exception would be if you are passing a literal value or constant.

Asya Kamsky
  • 41,784
  • 5
  • 109
  • 133