From 54accaff5b629d5c5957751f7ead8aadd78d2b93 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sat, 15 Apr 2017 12:22:35 +0300 Subject: [PATCH] WASM: use signed comparison for lookupswitch --- .../org/teavm/backend/wasm/generate/WasmGenerationVisitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerationVisitor.java b/core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerationVisitor.java index ae43064c1..3717068fe 100644 --- a/core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerationVisitor.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerationVisitor.java @@ -790,7 +790,7 @@ class WasmGenerationVisitor implements StatementVisitor, ExprVisitor { } else { int mid = (upper + lower) / 2; int label = entries.get(mid).label; - WasmExpression condition = new WasmIntBinary(WasmIntType.INT32, WasmIntBinaryOperation.GT_UNSIGNED, + WasmExpression condition = new WasmIntBinary(WasmIntType.INT32, WasmIntBinaryOperation.GT_SIGNED, new WasmGetLocal(conditionVar), new WasmInt32Constant(label)); WasmConditional conditional = new WasmConditional(condition); consumer.getBody().add(conditional);