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
mkdir build && cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
infer run --compilation-database compile_commands.json
only issues of lsanSuppressed.c have found:
/home/zhenjing/test/addressSanitizer/lsanSuppressed.c:14: error: Memory Leak
Memory dynamically allocated by malloc on line 14 is not freed after the last access at line 14, column 3.
12.
13. void FooBar() {
14. malloc(7);
^
15. }
16.
/home/zhenjing/test/addressSanitizer/lsanSuppressed.c:18: error: Memory Leak
Memory dynamically allocated by malloc on line 18 is not freed after the last access at line 18, column 3.
16.
17. void Baz() {
18. malloc(5);
^
19. }
20.
If infer single file, more issues will be found. infer run -- clang -c ../classMemberHeapOverflow.cpp
/home/zhenjing/test/addressSanitizer/classMemberHeapOverflow.cpp:110: error: Uninitialized Value __param_0.tofCamera is read without initialization during the call to Test::Init().
108. TCameraParam param;
109. Test* test = new Test();;
110. test->Init(param);
^
111.
112. return 0;
infer run -- clang -c ../useAfterFree.cpp
/home/zhenjing/test/addressSanitizer/useAfterFree.cpp:8: error: Use After Delete
accessing array that was invalidated by delete[] on line 7.
6. int *array = new int[100];
7. delete [] array;
8. return array[argc]; // BOOM
^
9. }
10.
How to use infer find out all issues in Cmake project?
The text was updated successfully, but these errors were encountered:
ENV:
Infer version v1.2.0 contos 7.4
I have a Cmake project. (addressSanitizer.zip).
run infer in the way:
only issues of lsanSuppressed.c have found:
If infer single file, more issues will be found.
infer run -- clang -c ../classMemberHeapOverflow.cpp
infer run -- clang -c ../useAfterFree.cpp
How to use infer find out all issues in Cmake project?
The text was updated successfully, but these errors were encountered: