Summary: While the symbolic heap analysis ends its search upon hitting the bound on recursion depth, the used-globals analysis should instead simply skip recursive calls beyond the depth. Note that this is unsound for arbitrary abstract domains, however, and the flag controlling this feature should be used with caution. Note that procedure calls are still not handled correctly, since Used_globals.exec_intrinsic does not properly check whether callees are intrinsic. A forthcoming commit will fix that, as well. Reviewed By: jberdine Differential Revision: D17479753 fbshipit-source-id: aa92e0ef3master
parent
00a5d3dd64
commit
6592eb609f
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
char* a = "I'm a string";
|
||||||
|
char* b = "I'm a different string";
|
||||||
|
char* c = "foo bar";
|
||||||
|
char* d = "hello world";
|
||||||
|
FILE* file;
|
||||||
|
|
||||||
|
void f();
|
||||||
|
void g();
|
||||||
|
|
||||||
|
int main() { // accesses: a,b,c,d
|
||||||
|
if (getc(file)) { // nondeterministic
|
||||||
|
f();
|
||||||
|
} else {
|
||||||
|
g();
|
||||||
|
}
|
||||||
|
char* s = a;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void f() { // accesses: b, c, d
|
||||||
|
char* s1 = b;
|
||||||
|
g();
|
||||||
|
char* s2 = c;
|
||||||
|
}
|
||||||
|
void g() { // accesses: b, c, d
|
||||||
|
char* s = d;
|
||||||
|
f();
|
||||||
|
}
|
Loading…
Reference in new issue