Skip to content

The expression 'not (8 > 0 or 42 > 0)' is compiled incorrectly by the GDSL compiler #20

@kranzj

Description

@kranzj

The expression 'not (8 > 0 or 42 > 0)' is compiled incorrectly by the GDSL compiler. Consider the following GDSL program:

export test_right : (int) -> |1|
export test_wrong : (int) -> |1|

val test_right x = not (8 > 0)
val test_wrong x = not (8 > 0 or 42 > 0)

The code is compiled into the C code shown below:

...
/* test_right */
static int_t test_right(state_t s,int_t x) {
  return vec_not(s,gen_vec(1, 0<8)).data;
}
/* test_wrong */
static int_t test_wrong(state_t s,int_t x) {
  return vec_not(s,gen_vec(0, (0<8) | (0<42))).data;
}
...

Here, the size of the vector is 1 in case of the test_right function, but 0 in case of test_wrong function. The size of the vector should be 1 in both cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions