[jruby-joni] 171/194: statically disable dynamic option
Hideki Yamane
henrich at moszumanska.debian.org
Thu Feb 1 12:04:38 UTC 2018
This is an automated email from the git hooks/post-receive script.
henrich pushed a commit to branch debian/sid
in repository jruby-joni.
commit c1911991387b9c898d09706fa2a878094598c2f9
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date: Tue Jan 16 21:16:05 2018 +0100
statically disable dynamic option
---
src/org/joni/ArrayCompiler.java | 6 +++---
src/org/joni/Config.java | 1 +
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/org/joni/ArrayCompiler.java b/src/org/joni/ArrayCompiler.java
index e10f6d5..ce1a326 100644
--- a/src/org/joni/ArrayCompiler.java
+++ b/src/org/joni/ArrayCompiler.java
@@ -795,7 +795,7 @@ final class ArrayCompiler extends Compiler {
int tlen = compileLengthTree(node.target);
regex.options = prev;
- if (isDynamic(prev ^ node.option)) {
+ if (Config.USE_DYNAMIC_OPTION && isDynamic(prev ^ node.option)) {
return OPSize.SET_OPTION_PUSH + OPSize.SET_OPTION + OPSize.FAIL + tlen + OPSize.SET_OPTION;
} else {
return tlen;
@@ -806,7 +806,7 @@ final class ArrayCompiler extends Compiler {
protected void compileOptionNode(EncloseNode node) {
int prev = regex.options;
- if (isDynamic(prev ^ node.option)) {
+ if (Config.USE_DYNAMIC_OPTION && isDynamic(prev ^ node.option)) {
addOpcodeOption(OPCode.SET_OPTION_PUSH, node.option);
addOpcodeOption(OPCode.SET_OPTION, prev);
addOpcode(OPCode.FAIL);
@@ -816,7 +816,7 @@ final class ArrayCompiler extends Compiler {
compileTree(node.target);
regex.options = prev;
- if (isDynamic(prev ^ node.option)) {
+ if (Config.USE_DYNAMIC_OPTION && isDynamic(prev ^ node.option)) {
addOpcodeOption(OPCode.SET_OPTION, prev);
}
}
diff --git a/src/org/joni/Config.java b/src/org/joni/Config.java
index 67ee911..c7c0209 100644
--- a/src/org/joni/Config.java
+++ b/src/org/joni/Config.java
@@ -44,6 +44,7 @@ public interface Config extends org.jcodings.Config {
final boolean USE_POSIX_API_REGION_OPTION = true; /* needed for POSIX API support */
final boolean USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE = true;
final boolean USE_CEC = false;
+ final boolean USE_DYNAMIC_OPTION = false;
final int NREGION = 10;
final int MAX_BACKREF_NUM = 1000;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jruby-joni.git
More information about the pkg-java-commits
mailing list