Skip to content

Commit

Permalink
[rust] Fix types in find_among skip checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jedav committed Nov 1, 2024
1 parent dce751f commit 9506b39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/generator_rust.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,13 +1132,13 @@ static void generate_substring(struct generator * g, struct node * p) {
*/
} else if (n_cases == 1) {
g->I[4] = cases[0];
writef(g, " || ~S1 as i32 != ~I4 as i32", p);
writef(g, " || ~S1 as u8 != ~I4 as u8", p);
} else if (n_cases == 2) {
g->I[4] = cases[0];
g->I[5] = cases[1];
writef(g, " || (~S1 as i32 != ~I4 as i32 && ~S1 as i32 != ~I5 as i32)", p);
writef(g, " || (~S1 as u8 != ~I4 as u8 && ~S1 as u8 != ~I5 as u8)", p);
} else {
writef(g, " || ~S1 as i32 >> 5 != ~I2 as i32 || !((~I3 as i32 >> (~S1 as i32 & 0x1f)) & 1) != 0", p);
writef(g, " || ~S1 as u8 >> 5 != ~I2 as u8 || ((~I3 as i32 >> (~S1 as u8 & 0x1f)) & 1) == 0", p);
}
write_string(g, ") ");
if (empty_case != -1) {
Expand Down

0 comments on commit 9506b39

Please sign in to comment.