Address PR10616. The crash has already been fixed by Ted in r140725, so just refactor to use existing API + test case.

llvm-svn: 140932
This commit is contained in:
Anna Zaks 2011-10-01 06:35:19 +00:00
parent 42856de542
commit 79ada929b7
2 changed files with 14 additions and 1 deletions

View File

@ -315,7 +315,7 @@ bugreporter::getTrackNullOrUndefValueVisitor(const ExplodedNode *N,
if (ps->getStmt() == S)
break;
}
N = N->pred_empty() ? 0 : *N->pred_begin();
N = N->getFirstPred();
}
if (!N)

View File

@ -0,0 +1,13 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core.DivideZero -verify %s
int fooPR10616 (int qX ) {
int a, c, d;
d = (qX-1);
while ( d != 0 ) {
d = c - (c/d) * d;
}
return (a % (qX-1)); // expected-warning {{Division by zero}}
}