mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
WASM: fix translation of lookupswitch when min and max values differ by
more than 2^31
This commit is contained in:
parent
6630175598
commit
d09affce85
|
@ -745,7 +745,7 @@ class WasmGenerationVisitor implements StatementVisitor, ExprVisitor {
|
|||
WasmBlock defaultTarget = wrapper;
|
||||
wrapper = defaultBlock;
|
||||
|
||||
if (max - min >= SWITCH_TABLE_THRESHOLD) {
|
||||
if ((long) max - (long) min >= SWITCH_TABLE_THRESHOLD) {
|
||||
translateSwitchToBinarySearch(statement, condition, initialWrapper, defaultTarget, targets);
|
||||
} else {
|
||||
translateSwitchToWasmSwitch(statement, condition, initialWrapper, defaultTarget, targets, min, max);
|
||||
|
@ -804,7 +804,7 @@ class WasmGenerationVisitor implements StatementVisitor, ExprVisitor {
|
|||
final int label;
|
||||
final WasmBlock target;
|
||||
|
||||
public TableEntry(int label, WasmBlock target) {
|
||||
TableEntry(int label, WasmBlock target) {
|
||||
this.label = label;
|
||||
this.target = target;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user