mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-03 19:32:35 +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) {
|
RetTy VisitOpaqueValueExpr(const OpaqueValueExpr *E) {
|
||||||
const CCValue *Value = Info.getOpaqueValue(E);
|
const CCValue *Value = Info.getOpaqueValue(E);
|
||||||
if (!Value)
|
if (!Value) {
|
||||||
return (E->getSourceExpr() ? StmtVisitorTy::Visit(E->getSourceExpr())
|
const Expr *Source = E->getSourceExpr();
|
||||||
: DerivedError(E));
|
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);
|
return DerivedSuccess(*Value, E);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user