diff options
author | Per Bothner <per@bothner.com> | 2017-11-07 17:48:35 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 2017-11-07 17:48:35 +0000 |
commit | 5ce5b5e8bcef482d9633a4170d0421b851b5007a (patch) | |
tree | b1223197ba35e3ffea40ca9757f46c726bff3c4f | |
parent | a9244841eca585e779897107cc34e7ddd568b02e (diff) | |
parent | 7f8e0a474ad2d09163739e461de95ca9f58cc71b (diff) |
Merge branch 'bytecode2' into 'bytecode2'bytecode2
Fix putLineNumber after emitGoto
See merge request kashell/Kawa!14
-rw-r--r-- | .gitlab-ci.yml | 14 | ||||
-rw-r--r-- | gnu/bytecode/CodeAttr.java | 18 |
2 files changed, 20 insertions, 12 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 377c38dfd..f74e1cdd5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: fedora:latest +image: debian:latest stages: - build_and_test @@ -6,12 +6,12 @@ stages: build_script: stage: build_and_test script: - - dnf update -y - - dnf install automake -y - - dnf install make -y - - dnf install texinfo -y - - dnf install java-1.8.0-openjdk-devel -y - - dnf install gcc -y + - apt-get -y update + - apt-get -y install automake + - apt-get -y install make + - apt-get -y install texinfo + - apt-get -y install openjdk-8-jdk + - apt-get -y install gcc - ./autogen.sh - ./configure - make diff --git a/gnu/bytecode/CodeAttr.java b/gnu/bytecode/CodeAttr.java index fcfe4bae0..789bca4b5 100644 --- a/gnu/bytecode/CodeAttr.java +++ b/gnu/bytecode/CodeAttr.java @@ -26,7 +26,8 @@ public class CodeAttr extends Attribute implements AttrContainer { Attribute attributes; Label prevGoto; - java.util.ArrayDeque<Label> afterGoto = new java.util.ArrayDeque<Label>(); + java.util.ArrayDeque<Label> afterGotoLabels = new java.util.ArrayDeque<Label>(); + java.util.ArrayDeque<Integer> afterGotoLineNumbers = new java.util.ArrayDeque<Integer>(); MethodVisitor mvisitor; int insnCount = 0; @@ -34,11 +35,13 @@ public class CodeAttr extends Attribute implements AttrContainer { if (prevGoto != null) { - if (!afterGoto.contains(prevGoto)) + if (!afterGotoLabels.contains(prevGoto)) emitJumpInsn(GOTO, prevGoto.asmLabel); - while (!afterGoto.isEmpty()) - mvisitor.visitLabel(afterGoto.poll().asmLabel); prevGoto = null; + while (!afterGotoLabels.isEmpty()) + mvisitor.visitLabel(afterGotoLabels.poll().asmLabel); + while (!afterGotoLineNumbers.isEmpty()) + putLineNumber(afterGotoLineNumbers.poll()); } } @@ -259,6 +262,11 @@ public class CodeAttr extends Attribute implements AttrContainer public final void putLineNumber(int linenumber) { + if (prevGoto != null) + { + afterGotoLineNumbers.add(linenumber); + return; + } if (linenumber == prev_linenumber) return; if (sourceDbgExt != null) @@ -430,7 +438,7 @@ public class CodeAttr extends Attribute implements AttrContainer void defineRaw(Label l) { if (prevGoto != null) - afterGoto.add(l); + afterGotoLabels.add(l); else mvisitor.visitLabel(l.asmLabel); } |