• Jérôme Hénin's avatar
    Fix Lepton optimization with -ffast-math · 144fa34a
    Jérôme Hénin authored
    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.
    144fa34a
ParsedExpression.cpp 21.9 KB