http://llvm.org/bugs/show_bug.cgi?id=2306
Summary: CHECKER: path sensitivity
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Semantic Analyzer
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
CC: [email protected]
Created an attachment (id=1629)
--> (http://llvm.org/bugs/attachment.cgi?id=1629)
checker html report
Using SVN r50942:
/home/edwin/llvm-svn/llvm/tools/clang/utils/ccc-analyzer -c path_sens.c
path_sens.c
ANALYZE: path_sens.c foo
path_sens.c:10:11: warning: [CHECKER] Dereference of null pointer.
return *bar;
^~~
1 diagnostic generated.
int foo(int left, int right)
{
int x=5;
int *bar = 0;
while(left<=right) {
left++;
bar = &x;
}
if(left<=right) {
return *bar;
}
return 0;
}
See the attached html report, it says that the while() condition is false, and
then the if() condition is true.
That can't happen, after the while (left<=right) is always false, hence the if
is never entered.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs