Fix Lepton optimization with -ffast-math
Lepton::ParsedExpression::getConstantValue() used to return NaN to indicate non-constant expressions. This can break with -ffast-math optimization where NaN comparisons are not defined. This patch defines bool isConstant() to test whether an expression is constant before calling getConstantValue(). getConstantValue() now throws an exception if called on a non-constant expression.
Showing
Please register or sign in to comment