From 9fac86da7ca1dbad4f27c179d3fbd6232588cc7d Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Wed, 15 Apr 2015 22:34:08 +0300 Subject: [PATCH] Fix bugs in try/catch generator --- .../src/main/java/org/teavm/javascript/Decompiler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java b/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java index efba6b520..c0b3e263b 100644 --- a/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java +++ b/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java @@ -343,7 +343,7 @@ public class Decompiler { TryCatchBookmark bookmark = oldBlock.tryCatches.get(j); TryCatchStatement tryCatchStmt = new TryCatchStatement(); tryCatchStmt.setExceptionType(bookmark.exceptionType); - tryCatchStmt.setExceptionVariable(tryCatchStmt.getExceptionVariable()); + tryCatchStmt.setExceptionVariable(bookmark.exceptionVariable); tryCatchStmt.getHandler().add(generator.generateJumpStatement( program.basicBlockAt(bookmark.exceptionHandler))); List blockPart = oldBlock.body.subList(bookmark.offset, oldBlock.body.size()); @@ -436,7 +436,7 @@ public class Decompiler { while (block != bookmark.block) { TryCatchStatement tryCatchStmt = new TryCatchStatement(); tryCatchStmt.setExceptionType(bookmark.exceptionType); - tryCatchStmt.setExceptionVariable(tryCatchStmt.getExceptionVariable()); + tryCatchStmt.setExceptionVariable(bookmark.exceptionVariable); tryCatchStmt.getHandler().add(generator.generateJumpStatement( program.basicBlockAt(bookmark.exceptionHandler))); tryCatchStmt.getProtectedBody().addAll(block.body); @@ -449,7 +449,7 @@ public class Decompiler { TryCatchStatement tryCatchStmt = new TryCatchStatement(); tryCatchStmt.setExceptionType(bookmark.exceptionType); - tryCatchStmt.setExceptionVariable(tryCatchStmt.getExceptionVariable()); + tryCatchStmt.setExceptionVariable(bookmark.exceptionVariable); tryCatchStmt.getHandler().add(generator.generateJumpStatement( program.basicBlockAt(bookmark.exceptionHandler))); List blockPart = block.body.subList(bookmark.offset, block.body.size());