aboutsummaryrefslogtreecommitdiffstats
path: root/org.jacoco.core/src/org/jacoco/core/instr/Instrumenter.java
diff options
context:
space:
mode:
authorMarc R. Hoffmann <hoffmann@mountainminds.com>2018-04-02 22:07:10 +0200
committerEvgeny Mandrikov <Godin@users.noreply.github.com>2018-04-02 22:07:10 +0200
commit65ad735cf564abeeb2517149843928d28740a559 (patch)
treed55c9c5cdd9b0fe940f68bda79439c1ad386d34f /org.jacoco.core/src/org/jacoco/core/instr/Instrumenter.java
parentac702e772b29a073da9d1b7b70d8b61610beedb3 (diff)
downloadplatform_external_jacoco-65ad735cf564abeeb2517149843928d28740a559.tar.gz
platform_external_jacoco-65ad735cf564abeeb2517149843928d28740a559.tar.bz2
platform_external_jacoco-65ad735cf564abeeb2517149843928d28740a559.zip
Don't insert stackmap frames into class files with version < 1.6. (#667)
For certain probes additional frames needs to be inserted, but only from class file version 1.6 on.
Diffstat (limited to 'org.jacoco.core/src/org/jacoco/core/instr/Instrumenter.java')
-rw-r--r--org.jacoco.core/src/org/jacoco/core/instr/Instrumenter.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.jacoco.core/src/org/jacoco/core/instr/Instrumenter.java b/org.jacoco.core/src/org/jacoco/core/instr/Instrumenter.java
index 85cba592..da956fd9 100644
--- a/org.jacoco.core/src/org/jacoco/core/instr/Instrumenter.java
+++ b/org.jacoco.core/src/org/jacoco/core/instr/Instrumenter.java
@@ -29,6 +29,7 @@ import org.jacoco.core.internal.data.CRC64;
import org.jacoco.core.internal.flow.ClassProbesAdapter;
import org.jacoco.core.internal.instr.ClassInstrumenter;
import org.jacoco.core.internal.instr.IProbeArrayStrategy;
+import org.jacoco.core.internal.instr.InstrSupport;
import org.jacoco.core.internal.instr.ProbeArrayStrategyFactory;
import org.jacoco.core.internal.instr.SignatureRemover;
import org.jacoco.core.runtime.IExecutionDataAccessorGenerator;
@@ -97,7 +98,8 @@ public class Instrumenter {
final IProbeArrayStrategy strategy = ProbeArrayStrategyFactory
.createFor(classId, reader, accessorGenerator);
final ClassVisitor visitor = new ClassProbesAdapter(
- new ClassInstrumenter(strategy, writer), true);
+ new ClassInstrumenter(strategy, writer),
+ InstrSupport.needsFrames(originalVersion));
reader.accept(visitor, ClassReader.EXPAND_FRAMES);
final byte[] instrumented = writer.toByteArray();
BytecodeVersion.set(instrumented, originalVersion);