Kaydet (Commit) 9c346feb authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Don't try to evaluate value of value-dependent Expr

...which causes asserts to fire since <https://github.com/llvm/llvm-project/
commit/04323c24a1ac9464471331d9f6499d3cb95d1ccd> "Added an assertion to constant
evaluation enty points that prohibits …"

Change-Id: Iafbf1cea85d15a38a71275d4cea8303bab500f6a
Reviewed-on: https://gerrit.libreoffice.org/72723
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst fd59a107
......@@ -100,7 +100,7 @@ private:
return;
}
APSInt val;
if (!rhs->isIntegerConstantExpr(val, compiler.getASTContext()))
if (rhs->isValueDependent() || !rhs->isIntegerConstantExpr(val, compiler.getASTContext()))
{
return;
}
......
......@@ -135,7 +135,7 @@ std::unique_ptr<APSInt> ExpressionAlwaysZero::getExprValue(Expr const * expr)
return std::unique_ptr<APSInt>();
}
APSInt x1;
if (compat::EvaluateAsInt(expr, x1, compiler.getASTContext()))
if (!expr->isValueDependent() && compat::EvaluateAsInt(expr, x1, compiler.getASTContext()))
return std::unique_ptr<APSInt>(new APSInt(x1));
return std::unique_ptr<APSInt>();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment