mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-03 19:32:35 +00:00
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:
parent
42856de542
commit
79ada929b7
@ -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)
|
||||
|
13
clang/test/Analysis/div-zero.cpp
Normal file
13
clang/test/Analysis/div-zero.cpp
Normal 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}}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user