summaryrefslogtreecommitdiff
path: root/ext/pcre/tests/no_jit_bug70110.phpt
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-11-16 14:12:05 +0100
committerAnatol Belski <ab@php.net>2017-11-16 14:12:05 +0100
commita370a6af647e27a334676a2c87bf686c6c973423 (patch)
tree77779494b4ff088d940952cdc1a4a14dc1b0b0f7 /ext/pcre/tests/no_jit_bug70110.phpt
parentacaaf4608acd9d74b31d992a1afa94767fda912b (diff)
downloadphp-git-a370a6af647e27a334676a2c87bf686c6c973423.tar.gz
Fix (*NO_JIT) usage when JIT is enabled
If (*NO_JIT) is put into the pattern, the JIT compilation will still succeed but produce no code. The pattern will still have to be interpreted and is not suitable for the JIT fast path. This means, we still need to check the pattern info after JIT compilation and only set the flags when the JIT code was produced.
Diffstat (limited to 'ext/pcre/tests/no_jit_bug70110.phpt')
-rw-r--r--ext/pcre/tests/no_jit_bug70110.phpt16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/pcre/tests/no_jit_bug70110.phpt b/ext/pcre/tests/no_jit_bug70110.phpt
new file mode 100644
index 0000000000..d1ce7abc4e
--- /dev/null
+++ b/ext/pcre/tests/no_jit_bug70110.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Test (*NO_JIT) doesn't crash when JIT enabled
+--SKIPIF--
+<?php if (!PCRE_JIT_SUPPORT) die("skip pcre jit support required"); ?>
+--FILE--
+<?php
+
+var_dump(preg_match('/(*NO_JIT)^(A{1,2}B)+$$/',str_repeat('AB',8192)));
+var_dump(preg_match('~(*NO_JIT)(a)*~', str_repeat('a', 5431), $match))
+
+?>
+==DONE==
+--EXPECTF--
+int(1)
+int(1)
+==DONE==