Opened 2 years ago

Last modified 2 years ago

#5395 new enhancement

Reduce number of ConstantEvaluationExceptions

Reported by: Zimon Kuhs Owned by: Jesper Mattsson
Priority: major Milestone:
Component: General Version: trunk
Keywords: Cc:

Description (last modified by Jesper Mattsson)

There are a lot of instances were a ConstantEvaluationException is thrown for a failed evaluation, even when CValue.UNKNOWN could easily be used instead.

As throwing and managing exceptions is costly, use CValue.UNKNOWN instead where reasonable.

Change History (3)

comment:1 Changed 2 years ago by Jesper Mattsson

Description: modified (diff)

comment:2 Changed 2 years ago by Zimon Kuhs


  • Changed arithmetic and relational operations on constants to return CValue.UNKNOWN when the operand type(s) is invalid.
  • FType operations checking for scalar types now check if the type is scalar first.
  • Changed AnnotationNode.bool() to not throw ConstantEvaluationExceptions.

comment:3 Changed 2 years ago by Jesper Mattsson


Went through all places that catch ConstantEvaluationException, and added checks to see if operations on CValues are expected to succeed before attempting them.

Note: See TracTickets for help on using tickets.