diff --git a/regex/src/main/java/org/pcre4j/regex/Matcher.java b/regex/src/main/java/org/pcre4j/regex/Matcher.java index f1e6216..fe8e13e 100644 --- a/regex/src/main/java/org/pcre4j/regex/Matcher.java +++ b/regex/src/main/java/org/pcre4j/regex/Matcher.java @@ -84,7 +84,7 @@ public class Matcher implements java.util.regex.MatchResult { /* package-private */ Matcher(Pattern pattern, CharSequence input) { this.pattern = pattern; this.matchContext = new Pcre2MatchContext(pattern.code.api(), null); - if (pattern.code instanceof Pcre2JitCode) { + if (pattern.code.jitSize() > 0) { this.jitStack = new Pcre2JitStack(pattern.code.api(), JIT_STACK_START_SIZE, JIT_STACK_MAX_SIZE, null); this.matchContext.assignJitStack(jitStack); } else { @@ -557,7 +557,7 @@ public Matcher usePattern(Pattern newPattern) { this.pattern = newPattern; this.matchContext = new Pcre2MatchContext(pattern.code.api(), null); - if (pattern.code instanceof Pcre2JitCode) { + if (pattern.code.jitSize() > 0) { this.jitStack = new Pcre2JitStack(pattern.code.api(), JIT_STACK_START_SIZE, JIT_STACK_MAX_SIZE, null); this.matchContext.assignJitStack(jitStack); } else {