Skip to content

Commit

Permalink
Update KaitaiStruct compiler and runtime to 0.9 - may be this fix Jit…
Browse files Browse the repository at this point in the history
…Pack error...
  • Loading branch information
Mingun committed Oct 28, 2021
1 parent 7ac2ad0 commit 299151b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
<dependency>
<groupId>io.kaitai</groupId>
<artifactId>kaitai-struct-runtime</artifactId>
<version>0.8</version>
<version>0.9</version>
</dependency>
<dependency>
<groupId>io.kaitai</groupId>
<artifactId>kaitai-struct-compiler_2.12</artifactId>
<version>0.8</version>
<version>0.9</version>
</dependency>
<dependency>
<groupId>com.github.Mingun</groupId>
Expand Down
19 changes: 15 additions & 4 deletions src/main/java/io/kaitai/struct/visualizer/VisualizerPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import io.kaitai.struct.ByteBufferKaitaiStream;
import io.kaitai.struct.CompileLog;
import io.kaitai.struct.JavaRuntimeConfig;
import io.kaitai.struct.KaitaiStream;
import io.kaitai.struct.KaitaiStruct;
import io.kaitai.struct.Main;
Expand Down Expand Up @@ -39,6 +40,7 @@
import tv.porst.jhexview.SimpleDataProvider;

public class VisualizerPanel extends JPanel {
/** Package to generate classes in. */
private static final String DEST_PACKAGE = "io.kaitai.struct.visualized";
/**
* Regexp with 2 groups: class name and type parameters. Type parameters
Expand Down Expand Up @@ -127,14 +129,23 @@ private static String compileKSY(String ksyFileName) {
final JavaClassSpecs specs = new JavaClassSpecs(null, null, spec);

final RuntimeConfig config = new RuntimeConfig(
true, // debug - required for existing _attrStart/_attrEnd/_arrStart/_arrEnd fields
false,// autoRead - required for existing _attrStart/_attrEnd/_arrStart/_arrEnd fields
true, // readStorePos - required for existing _attrStart/_attrEnd/_arrStart/_arrEnd fields
true, // opaqueTypes
null, // cppConfig
null, // goPackage
DEST_PACKAGE,
"io.kaitai.struct.ByteBufferKaitaiStream",
new JavaRuntimeConfig(
DEST_PACKAGE,
// Class to be invoked in `fromFile` helper methods
"io.kaitai.struct.ByteBufferKaitaiStream",
// Exception class expected to be thrown on end-of-stream errors
"java.nio.BufferUnderflowException"
),
null, // dotNetNamespace
null, // phpNamespace
null // pythonPackage
null, // pythonPackage
null, // nimModule
null // nimOpaque
);

Main.importAndPrecompile(specs, config).value();
Expand Down

0 comments on commit 299151b

Please sign in to comment.