Skip to content

Hotfix arithmetic bug

Yen-Chen Chen requested to merge hotfix_arithmetic_bug into master

There is a bug in util_arithmetic_expr that compares a pointer to a string.
This bug results in the function left_associative not working as expected.
And therefore produces wrong expression results for complicated expressions with ^ operators.

The test TEST_exr_3 + 4*2/(1 - 5)^2^3 is a very good example.
When we use left-associative (default for C) for the power operator, the expression x^2^3 should be (x^2)^3=x^6.
When we use right-associative (default for Fortran) for the power operator, the expression x^2^3 should be x^(2^3)=x^8.
This branch fixes this bug.

Additionally, this branch also fixed the problem that the Ragel state machine no longer compiles the *.rl files.
This branch also updates FortUTF to the latest version.

Edited by Yen-Chen Chen

Merge request reports

Loading