Skip to content

Wrong handling of equality/inequality operators by Data Flow Optimization #146

Description

@cardillan

This one is a bit embarrassing: the Data Flow Optimizer is meant to consider the expressions a < b identical to b > a, and a <= b identical to b >= a. In addition to this, it also considered a == b identical to b != a - I assumed that swapping the arguments and inverting the relation works without realizing it doesn't work for equality. Oops.

An example of the affected code is

inline def eval(b)
    b ? "true" : "false";
end;

inline def compare(a, b)
    print(eval(a == b), ", ", eval(a != b));
end;

compare("A", "A");

Due to the bug, this code prints "true, true" instead on "true, false".

There is also an unrelated bug in the processor emulator, which causes objects to be converted to the value 0 instead of 1. The processor emulator fortunately doesn't affect production code yet.

A fix will be coming shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoptimizerRelated to the code optimizer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions