mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-02 18:58:15 +00:00
In ExprEvaluatorBase::VisitOpaqueValueExpr() add a sanity check to avoid
infinite recursion due to bad OpaqueValueExpr. llvm-svn: 146237
This commit is contained in:
parent
10c7c9090e
commit
fac35c0a9b
@ -1557,9 +1557,16 @@ public:
|
||||
|
||||
RetTy VisitOpaqueValueExpr(const OpaqueValueExpr *E) {
|
||||
const CCValue *Value = Info.getOpaqueValue(E);
|
||||
if (!Value)
|
||||
return (E->getSourceExpr() ? StmtVisitorTy::Visit(E->getSourceExpr())
|
||||
: DerivedError(E));
|
||||
if (!Value) {
|
||||
const Expr *Source = E->getSourceExpr();
|
||||
if (!Source)
|
||||
return DerivedError(E);
|
||||
if (Source == E) { // sanity checking.
|
||||
assert(0 && "OpaqueValueExpr recursively refers to itself");
|
||||
return DerivedError(E);
|
||||
}
|
||||
return StmtVisitorTy::Visit(Source);
|
||||
}
|
||||
return DerivedSuccess(*Value, E);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user