Skip to content

Commit

Permalink
Fix undefined-santitizer warning in rax test (valkey-io#1122)
Browse files Browse the repository at this point in the history
Fix the warning introduced in valkey-io#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 <viktor.soderqvist@est.tech>
  • Loading branch information
zuiderkwast authored and eifrah-aws committed Oct 20, 2024
1 parent 245340b commit 6dce172
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 6dce172

Please sign in to comment.