diff options
author | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2018-04-02 22:07:10 +0200 |
---|---|---|
committer | Evgeny Mandrikov <Godin@users.noreply.github.com> | 2018-04-02 22:07:10 +0200 |
commit | 65ad735cf564abeeb2517149843928d28740a559 (patch) | |
tree | d55c9c5cdd9b0fe940f68bda79439c1ad386d34f /org.jacoco.core/src/org/jacoco/core/instr/Instrumenter.java | |
parent | ac702e772b29a073da9d1b7b70d8b61610beedb3 (diff) | |
download | platform_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.java | 4 |
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); |