diff --git a/README.md b/README.md index 35bc3d9e0..a56f09025 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The easiest way to create a new TeaVM project is to type in the command line: mvn -DarchetypeCatalog=local \ -DarchetypeGroupId=org.teavm \ -DarchetypeArtifactId=teavm-maven-webapp \ - -DarchetypeVersion=0.2.0 archetype:generate + -DarchetypeVersion=0.2.1 archetype:generate Now you can execute `mvn clean package` and get the generated `war` file. Deploy this `war` in Tomcat or another container, or simply unzip it and open the `index.html` page. @@ -68,3 +68,9 @@ Another example is avaialble [here](http://graphhopper.com/teavm/). It uses [GraphHopper](https://github.com/graphhopper/graphhopper/) to build route in browser. Unlike original GraphHopper example it works completely in browser instead of querying server. Thanks to [Peter Karich](https://github.com/karussell). + + +Feedback +-------- + +Ask your questions by email: info@teavm.org. Also you can report issues on a project's [issue tracker](https://github.com/konsoletyper/teavm/issues). diff --git a/teavm-classlib/src/test/java/org/teavm/classlib/java/lang/VMTest.java b/teavm-classlib/src/test/java/org/teavm/classlib/java/lang/VMTest.java index a8963c000..bc77f5f6b 100644 --- a/teavm-classlib/src/test/java/org/teavm/classlib/java/lang/VMTest.java +++ b/teavm-classlib/src/test/java/org/teavm/classlib/java/lang/VMTest.java @@ -83,4 +83,17 @@ public class VMTest { public void surrogateInStringLiteralsWork() { assertEquals(0xDDC2, "a\uDDC2b".charAt(1)); } + + @Test + public void separatesExceptionAndVariable() { + int n = foo(); + try { + bar(); + } catch (RuntimeException e) { + assertEquals(RuntimeException.class, e.getClass()); + assertEquals(2, n); + } + } + private int foo() { return 2; } + private void bar() { throw new RuntimeException(); } } diff --git a/teavm-core/src/main/java/org/teavm/model/util/InterferenceGraphBuilder.java b/teavm-core/src/main/java/org/teavm/model/util/InterferenceGraphBuilder.java index e39480eaf..1ef421e12 100644 --- a/teavm-core/src/main/java/org/teavm/model/util/InterferenceGraphBuilder.java +++ b/teavm-core/src/main/java/org/teavm/model/util/InterferenceGraphBuilder.java @@ -41,6 +41,9 @@ class InterferenceGraphBuilder { for (BasicBlock succ : succExtractor.getTargets()) { liveOut.or(liveness.liveIn(succ.getIndex())); } + for (TryCatchBlock tryCatch : block.getTryCatchBlocks()) { + liveOut.or(liveness.liveIn(tryCatch.getHandler().getIndex())); + } live.clear(); for (int j = 0; j < liveOut.length(); ++j) { if (liveOut.get(j)) {