You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CHC: Add command-line argument handling to a number of checkers
The logic was already in both cCHPOCheckNotNull.ml and in
cCHPOQuery.ml, although cCHPOCheckNotNull.ml was using
its own function instead of the one in the POQuery object.
This adds calls to the util function in the POQuery object and
nukes the private function in CheckNotNull.
With these changes, a simple hello world program no longer gets a
ton of open POs:
```
int main(int argc, char **argv) {
if (argc != 2) {
printf("ERROR: usage: %s <name>\n", argv[0]);
return 1;
}
printf("Hello world %s\n", argv[1]);
--------------------------------------------------------------------------------
| initialized-range((*(argv + 1):((char *) *)), len:cnapp(ntp((*(argv + 1):((char *) *))))|
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| valid-mem((*(argv + 1):((char *) *))) |
| [augv[call]:$fn-entry$(-1):calls]:none |
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| null-terminated((*(argv + 1):((char *) *))) |
| no invariants found for *(((lval (argv) +i 1):((char*)*)) |
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| upper-bound(char,(*(argv + 1):((char *) *))) |
| no invariants for *(((lval (argv) +i 1):((char*)*)) |
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| lower-bound(char,(*(argv + 1):((char *) *))) |
| no invariants found for *(((lval (argv) +i 1):((char*)*)) |
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| ptr-upper-bound((*(argv + 1):((char *) *)), cnapp(ntp((*(argv + 1):((char *) *))), op:pluspi, typ: char)|
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| in-scope((*(argv + 1):((char *) *))) |
| no invariants found for *(((lval (argv) +i 1):((char*)*)) |
--------------------------------------------------------------------------------
```
There's still one open pre-condition that I haven't figured out how to
close:
--------------------------------------------------------------------------------
| Preconditions: |
| ptr-upper-bound-deref(argv, 1, op:indexpi, typ: (char *)) |
--------------------------------------------------------------------------------
0 commit comments