Open qequ opened 1 year ago
ping? @jvillard ?
The function names in the TOPL transitions are interpreted as regexes over the name of the function being called so func1
will match a function called func1
, not the variable you set in the other transition. Similarly for (*f)
and (*hello)
.
But, good news! The last config does in fact seem to work but requires to enable --function-pointer-specialization
. I'll see if we can make it enabled by default.
$ cat topl_fptr.topl
property RepeatArgument
prefix "repeat"
start -> start: *
start -> trackingHello: hello(Arg1, VoidRet) => x := Arg1
trackingHello -> error: world(Arg2, VoidRet) when x != Arg2
$ infer --topl-only --topl-properties topl_fptr.topl --function-pointer-specialization -- clang -c topl_fptr.c
topl_fptr.c:17: error: Topl Error
property RepeatArgument fails.
15. }
16.
17. void callfunctions(void (*f)(int), void (*g)(int))
^
18.
19. {
Found 1 issue
Issue Type(ISSUED_TYPE_ID): #
Topl Error(TOPL_ERROR): 1
Please make sure your issue is not addressed in the FAQ.
Please include the following information:
[x] The version of infer from
infer --version
.[x] Your operating system and version, for example "Debian 9", "MacOS High Sierra", whether you are using Docker, etc.
[x] Which command you ran, for example
infer -- make
.[x] The full output in a paste, for instance a gist.
[x] If possible, a minimal example to reproduce your problem (for instance, some code where infer reports incorrectly, together with the way you run infer to reproduce the incorrect report).
infer version
Infer version v1.1.0
OS; Ubuntu 20.04.5 LTS
Having a C program like this
and topl file like this
calling infer with the command
infer --topl --topl-properties test_ptr.topl -- gcc test_rep_arg_ptr.c
infer doesn't catch the error in the code and generates this output
with different variants of topl file looking directly for the functions like
no issue has been found
CC: @dgutson