Skip to content

Commit

Permalink
Fix undefined-santitizer warning in rax test (#1122)
Browse files Browse the repository at this point in the history
Fix the warning introduced in #688:

```
unit/test_rax.c:168:15: runtime error: left shift of 36625 by 16 places cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior unit/test_rax.c:168:15 in 
Fuzz test in mode 1 [7504]: 
```

Signed-off-by: Viktor Söderqvist <[email protected]>
  • Loading branch information
zuiderkwast authored Oct 3, 2024
1 parent 150c197 commit dcac3e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unit/test_rax.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static uint32_t int2int(uint32_t input) {
r = l ^ F;
l = nl;
}
return (r << 16) | l;
return ((uint32_t)r << 16) | l;
}

/* Turn an uint32_t integer into an alphanumerical key and return its
Expand Down

0 comments on commit dcac3e1

Please sign in to comment.