aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Mandrikov <138671+Godin@users.noreply.github.com>2019-03-08 19:19:13 +0100
committerMarc R. Hoffmann <hoffmann@mountainminds.com>2019-03-08 19:19:13 +0100
commit23d835d5eb0f62a7ff036c5e74d933f0de407e7c (patch)
tree8c92e6fab96e2530fe4124ffd8d63fb37a93d655
parent375a3dc9b5660047f352480d784fe071437154b8 (diff)
downloadplatform_external_jacoco-23d835d5eb0f62a7ff036c5e74d933f0de407e7c.tar.gz
platform_external_jacoco-23d835d5eb0f62a7ff036c5e74d933f0de407e7c.tar.bz2
platform_external_jacoco-23d835d5eb0f62a7ff036c5e74d933f0de407e7c.zip
Method `needsFrames` should also consider high byte of version (#854)
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java2
-rw-r--r--org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java2
2 files changed, 3 insertions, 1 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java
index d679cdbb..8345ac1b 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java
@@ -128,6 +128,8 @@ public class InstrSupportTest {
assertTrue(InstrSupport.needsFrames(Opcodes.V11));
assertTrue(InstrSupport.needsFrames(Opcodes.V12));
assertTrue(InstrSupport.needsFrames(Opcodes.V12 + 1));
+
+ assertTrue(InstrSupport.needsFrames(0x0100));
}
@Test
diff --git a/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java b/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java
index 1e438958..85e83a3a 100644
--- a/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java
+++ b/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java
@@ -215,7 +215,7 @@ public final class InstrSupport {
*/
public static boolean needsFrames(final int version) {
// consider major version only (due to 1.1 anomaly)
- return (version & 0xff) >= Opcodes.V1_6;
+ return (version & 0xFFFF) >= Opcodes.V1_6;
}
/**