Commit 537d22f
committed
target/riscv: fix ub during instruction decode
A left shift operation caused an implicit integer promotion, triggering
the following UBSan error:
```
left shift of 254 by 24 places cannot be represented in type 'int'
```
NOTE: it seems that this code won't work correctly with BE targets,
however this is a general problem of the whole implementation anyway.
Signed-off-by: Anatoly Parshintsev <[email protected]>1 parent 608ba43 commit 537d22f
1 file changed
+3
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2370 | 2370 | | |
2371 | 2371 | | |
2372 | 2372 | | |
2373 | | - | |
2374 | 2373 | | |
2375 | 2374 | | |
2376 | 2375 | | |
2377 | | - | |
2378 | | - | |
| 2376 | + | |
| 2377 | + | |
2379 | 2378 | | |
2380 | 2379 | | |
2381 | 2380 | | |
2382 | 2381 | | |
2383 | 2382 | | |
2384 | | - | |
2385 | | - | |
2386 | | - | |
2387 | | - | |
2388 | | - | |
2389 | | - | |
| 2383 | + | |
2390 | 2384 | | |
2391 | 2385 | | |
2392 | 2386 | | |
| |||
0 commit comments