https://bugs.llvm.org/show_bug.cgi?id=32925
Bug ID: 32925
Summary: analyser reports real issue, but misses use of
undefined variable on the way
Product: tools
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: analyze
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Created attachment 18410
--> https://bugs.llvm.org/attachment.cgi?id=18410&action=edit
buggy for/else
Behaviour observer in 3.8, 3.9, 4.0, and snapshot of 5.0 in Debian
$ scan-build clang++ -c ./src/foo.cpp
scan-build: Using '/usr/lib/llvm-3.8/bin/clang' for static analysis
./src/foo.cpp:28:20: warning: Dereference of undefined pointer value
printf("%d\n", p->d);
^~~~
1 warning generated.
scan-build: 1 bug found.
This is a buggy implementation of a pythobun-like "for / else" idiom.
In the path leading to this, which corresponds to m==0, the (i == m) test
compares m with uninitialized variable i. It would seem logical to report this
first (the fact is, it is the root of the bug).
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs