Skip to content

fpexprpars: fix access violation when setting an expression after clear

Luiz Américo requested to merge blikblum/fpc:fix-fpexprpars-clear into main

Summary

  • Calls FreeAndNil in TFPExpressionParser.Clear
  • Remove redundant assignment of FExprNode to nil in SetExpression (it always be nil)
  • Add test case for the bug
  • Use compatible FormatSettings when testing float values (fix fpexprpars tests when system use a non US format settings)

What is the current bug behavior?

Setting a new Expression after calling Clear gives an access violation because the code that parses the expression tries to access an invalid address at FExprNode

What is the behavior after applying this patch?

Setting an Expression after Clear works

Relevant logs and/or screenshots

Merge request reports