mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-13 20:20:50 +00:00
Compare commits
85
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
793d775b04 | ||
|
|
06e78cad83 | ||
|
|
ae2150692a | ||
|
|
4bec59f175 | ||
|
|
2c5860517c | ||
|
|
c05a069adf | ||
|
|
18172303f4 | ||
|
|
b48f2625b5 | ||
|
|
0cecf83b26 | ||
|
|
1aa419dcdc | ||
|
|
c47b18a222 | ||
|
|
27bb3289ac | ||
|
|
37d11d123e | ||
|
|
7e39e6934d | ||
|
|
c62cd9a43a | ||
|
|
cbb0efaeeb | ||
|
|
eb846939b1 | ||
|
|
3e35b08980 | ||
|
|
0f078f6e78 | ||
|
|
bacfae8baf | ||
|
|
22dec2b323 | ||
|
|
864f5ef12f | ||
|
|
897d99c7a4 | ||
|
|
189f625e2b | ||
|
|
3d50131ef7 | ||
|
|
b94c28b0e6 | ||
|
|
0e413241ec | ||
|
|
9705e631a4 | ||
|
|
a62154564d | ||
|
|
5cb4686753 | ||
|
|
6d5cddabaf | ||
|
|
c14eb8de97 | ||
|
|
b74a300edf | ||
|
|
a65b8abf2c | ||
|
|
d348cfb96f | ||
|
|
eb23c60087 | ||
|
|
b771a18133 | ||
|
|
0e6c0654ed | ||
|
|
a5a15965da | ||
|
|
518a160b65 | ||
|
|
621598eaa8 | ||
|
|
87691e74e5 | ||
|
|
17a9f1401a | ||
|
|
e1202733a5 | ||
|
|
b5d2cbe027 | ||
|
|
249e49092d | ||
|
|
fac43d6515 | ||
|
|
c8e9aa854c | ||
|
|
65bbc67063 | ||
|
|
3444b90746 | ||
|
|
d2cfb63f02 | ||
|
|
861fa60814 | ||
|
|
600f1f898f | ||
|
|
bb735c9e9e | ||
|
|
3d81c54879 | ||
|
|
db420cb6a1 | ||
|
|
1979c5d16f | ||
|
|
8c4b0ddde5 | ||
|
|
ff2140c49d | ||
|
|
c55d09c2f5 | ||
|
|
fee38633d2 | ||
|
|
23c65a8173 | ||
|
|
bb30fe9e2b | ||
|
|
e1da72bdf1 | ||
|
|
e981f5af51 | ||
|
|
c7141412ce | ||
|
|
b4f501d5a4 | ||
|
|
9b92c1d154 | ||
|
|
3b46fbfc36 | ||
|
|
f6eac76b65 | ||
|
|
e72e3370c6 | ||
|
|
a2c41c0ea6 | ||
|
|
39d04f15f8 | ||
|
|
9083e178f6 | ||
|
|
ea2a125789 | ||
|
|
2c9926f156 | ||
|
|
4a55794b98 | ||
|
|
b9dfa12853 | ||
|
|
6dcc0b859f | ||
|
|
29f4939923 | ||
|
|
ee243bc471 | ||
|
|
8d2a9d8859 | ||
|
|
5fa6dcd972 | ||
|
|
6d4965febd | ||
|
|
4c9ba3e042 |
No files matched your search
@@ -1,6 +1,108 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 7.3.12
|
||||
?? ??? ????, PHP 7.3.14
|
||||
|
||||
23 Jan 2020, PHP 7.3.14
|
||||
|
||||
- Core
|
||||
. Fixed bug #78999 (Cycle leak when using function result as temporary).
|
||||
(Dmitry)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #79033 (Curl timeout error with specific url and post). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #79015 (undefined-behavior in php_date.c). (cmb)
|
||||
|
||||
- DBA:
|
||||
. Fixed bug #78808 ([LMDB] MDB_MAP_FULL: Environment mapsize limit reached).
|
||||
(cmb)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #74170 (locale information change after mime_content_type).
|
||||
(Sergei Turchanov)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #78923 (Artifacts when convoluting image with transparency).
|
||||
(wilson chen)
|
||||
. Fixed bug #79067 (gdTransformAffineCopy() may use unitialized values). (cmb)
|
||||
. Fixed bug #79068 (gdTransformAffineCopy() changes interpolation method).
|
||||
(cmb)
|
||||
|
||||
- Libxml:
|
||||
. Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter). (Laruence)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #79040 (Warning Opcode handlers are unusable due to ASLR). (cmb)
|
||||
|
||||
- Pcntl:
|
||||
. Fixed bug #78402 (Converting null to string in error message is bad DX).
|
||||
(SATŌ Kentarō)
|
||||
|
||||
- PDO_PgSQL:
|
||||
. Fixed bug #78983 (pdo_pgsql config.w32 cannot find libpq-fe.h). (SATŌ
|
||||
Kentarō)
|
||||
. Fixed bug #78980 (pgsqlGetNotify() overlooks dead connection). (SATŌ
|
||||
Kentarō)
|
||||
. Fixed bug #78982 (pdo_pgsql returns dead persistent connection). (SATŌ
|
||||
Kentarō)
|
||||
|
||||
- Shmop:
|
||||
. Fixed bug #78538 (shmop memory leak). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #54298 (Using empty additional_headers adding extraneous CRLF).
|
||||
(cmb)
|
||||
|
||||
18 Dec 2019, PHP 7.3.13
|
||||
|
||||
- Bcmath:
|
||||
. Fixed bug #78878 (Buffer underflow in bc_shift_addsub). (CVE-2019-11046).
|
||||
(cmb)
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78862 (link() silently truncates after a null byte on Windows).
|
||||
(CVE-2019-11044). (cmb)
|
||||
. Fixed bug #78863 (DirectoryIterator class silently truncates after a null
|
||||
byte). (CVE-2019-11045). (cmb)
|
||||
. Fixed bug #78943 (mail() may release string with refcount==1 twice).
|
||||
(CVE-2019-11049). (cmb)
|
||||
. Fixed bug #78787 (Segfault with trait overriding inherited private shadow
|
||||
property). (Nikita)
|
||||
. Fixed bug #78868 (Calling __autoload() with incorrect EG(fake_scope) value).
|
||||
(Antony Dovgal, Dmitry)
|
||||
. Fixed bug #78296 (is_file fails to detect file). (cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #78793 (Use-after-free in exif parsing under memory sanitizer).
|
||||
(CVE-2019-11050). (Nikita)
|
||||
. Fixed bug #78910 (Heap-buffer-overflow READ in exif). (CVE-2019-11047).
|
||||
(Nikita)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #78849 (GD build broken with -D SIGNED_COMPARE_SLOW). (cmb)
|
||||
|
||||
- MBString:
|
||||
. Upgraded bundled Oniguruma to 6.9.4. (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed potential ASLR related invalid opline handler issues. (cmb)
|
||||
. Fixed $x = (bool)$x; with opcache (should emit undeclared variable notice).
|
||||
(Tyson Andre)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #78853 (preg_match() may return integer > 1). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #78759 (array_search in $GLOBALS). (Nikita)
|
||||
. Fixed bug #77638 (var_export'ing certain class instances segfaults). (cmb)
|
||||
. Fixed bug #78840 (imploding $GLOBALS crashes). (cmb)
|
||||
. Fixed bug #78833 (Integer overflow in pack causes out-of-bound access).
|
||||
(cmb)
|
||||
. Fixed bug #78814 (strip_tags allows / in tag name => whitelist bypass).
|
||||
(cmb)
|
||||
|
||||
21 Nov 2019, PHP 7.3.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78658 (Memory corruption using Closure::bindTo). (Nikita)
|
||||
|
||||
+7
-1
@@ -721,6 +721,7 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
TSRM_API int shmdt(const void *shmaddr)
|
||||
{/*{{{*/
|
||||
shm_pair *shm = shm_get(0, (void*)shmaddr);
|
||||
int ret;
|
||||
|
||||
if (!shm->segment) {
|
||||
return -1;
|
||||
@@ -730,7 +731,12 @@ TSRM_API int shmdt(const void *shmaddr)
|
||||
shm->descriptor->shm_lpid = getpid();
|
||||
shm->descriptor->shm_nattch--;
|
||||
|
||||
return UnmapViewOfFile(shm->addr) ? 0 : -1;
|
||||
ret = UnmapViewOfFile(shm->addr) ? 0 : -1;
|
||||
if (!ret && shm->descriptor->shm_nattch <= 0) {
|
||||
ret = UnmapViewOfFile(shm->descriptor) ? 0 : -1;
|
||||
shm->descriptor = NULL;
|
||||
}
|
||||
return ret;
|
||||
}/*}}}*/
|
||||
|
||||
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf)
|
||||
|
||||
@@ -490,6 +490,12 @@ JSON:
|
||||
Curl:
|
||||
. libcurl >= 7.15.5 is now required.
|
||||
|
||||
DBA:
|
||||
. As of PHP 7.3.14, dba_open() accepts a fifth optional parameter for lmdb
|
||||
databases which allows to specify the mapsize. The parameter defaults to
|
||||
zero, in which case the compiled in default mapsize (usually 1048576) will
|
||||
be used. The mapsize should be a multiple of the page size of the OS.
|
||||
|
||||
Filter:
|
||||
. FILTER_VALIDATE_FLOAT now also supports a `thousand` option, which
|
||||
defines the set of allowed thousand separator chars. The default (`"',."`)
|
||||
|
||||
@@ -94,7 +94,7 @@ L0:
|
||||
}
|
||||
}));
|
||||
|
||||
assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X {
|
||||
assert(0 && ($a = function &(?array &$a, X $b = null) use ($c,&$d) : X {
|
||||
class A {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof foo;
|
||||
@@ -244,7 +244,7 @@ Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c,
|
||||
|
||||
})) failed in %sexpect_015.php on line %d
|
||||
|
||||
Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X {
|
||||
Warning: assert(): assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
|
||||
class A {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof foo;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #78787: Segfault with trait overriding inherited private shadow property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T {
|
||||
private $prop;
|
||||
}
|
||||
class C1 {
|
||||
/** Doc comment */
|
||||
private $prop;
|
||||
}
|
||||
class C2 extends C1 {
|
||||
}
|
||||
class C3 extends C2 {
|
||||
use T;
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #78868: Calling __autoload() with incorrect EG(fake_scope) value
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
private $private = 1;
|
||||
|
||||
function foo() {
|
||||
$this->private++; //fails with EG(fake_scope) != NULL && EG(fake_scope) != "C"
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
static $foo = B::foo; //not resolved on include()
|
||||
}
|
||||
|
||||
function main_autoload($class_name) {
|
||||
$c = new C;
|
||||
$c->foo();
|
||||
//doesn't affect the error
|
||||
eval("class B {const foo = 1;}");
|
||||
}
|
||||
|
||||
spl_autoload_register('main_autoload', false);
|
||||
|
||||
$classA = new ReflectionClass("A");
|
||||
$props = $classA->getProperties();
|
||||
$props[0]->setValue(2); //causes constant resolving, which runs autoload, all with EG(fake_scope) == "A"
|
||||
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #78921: When Reflection triggers class load, property visibility is incorrect
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($className) {
|
||||
if ($className == 'PrivateStatic') {
|
||||
class PrivateStatic
|
||||
{
|
||||
const SOME_CONST = 13;
|
||||
private static $privateStaticVarArray = ['a', 'b', 'c'];
|
||||
private static $otherStatic;
|
||||
public static function init()
|
||||
{
|
||||
self::$otherStatic = self::$privateStaticVarArray;
|
||||
}
|
||||
}
|
||||
PrivateStatic::init();
|
||||
}
|
||||
});
|
||||
|
||||
class OtherClass
|
||||
{
|
||||
const MY_CONST = PrivateStatic::SOME_CONST;
|
||||
public static $prop = 'my property';
|
||||
}
|
||||
|
||||
$reflectionClass = new ReflectionClass('OtherClass');
|
||||
$reflectionProperty = $reflectionClass->getProperty('prop');
|
||||
$reflectionProperty->setAccessible(true);
|
||||
$value = $reflectionProperty->getValue();
|
||||
echo "Value is $value\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Value is my property
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #78999 (Cycle leak when using function result as temporary)
|
||||
--FILE--
|
||||
<?php
|
||||
function get() {
|
||||
$t = new stdClass;
|
||||
$t->prop = $t;
|
||||
return $t;
|
||||
}
|
||||
var_dump(get());
|
||||
var_dump(gc_collect_cycles());
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["prop"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
int(1)
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Incorrect constant evaluation of and/or (OSS-Fuzz #19255)
|
||||
--FILE--
|
||||
<?php
|
||||
const C = 0 && __namespace__;
|
||||
var_dump(C);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Freeing of function "name" when dynamic call fails
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
$bar = "bar";
|
||||
("foo" . $bar)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
$bar = ["bar"];
|
||||
(["foo"] + $bar)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
(new stdClass)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Call to undefined function foobar()
|
||||
Function name must be a string
|
||||
Function name must be a string
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Generator exceptions during shutdown should not be swallowed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
try {
|
||||
echo "before yield\n";
|
||||
yield;
|
||||
echo "after yield\n";
|
||||
} finally {
|
||||
echo "before yield in finally\n";
|
||||
yield;
|
||||
echo "after yield in finally\n";
|
||||
}
|
||||
echo "after finally\n";
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
$gen->rewind();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
before yield
|
||||
before yield in finally
|
||||
|
||||
Fatal error: Uncaught Error: Cannot yield from finally in a force-closed generator in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "3.3.12-dev"
|
||||
#define ZEND_VERSION "3.3.14RC1"
|
||||
|
||||
#define ZEND_ENGINE_3
|
||||
|
||||
|
||||
@@ -4082,6 +4082,12 @@ ZEND_API int zend_update_static_property_ex(zend_class_entry *scope, zend_string
|
||||
zval *property;
|
||||
zend_class_entry *old_scope = EG(fake_scope);
|
||||
|
||||
if (UNEXPECTED(!(scope->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) {
|
||||
if (UNEXPECTED(zend_update_class_constants(scope)) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
EG(fake_scope) = scope;
|
||||
property = zend_std_get_static_property(scope, name, 0);
|
||||
EG(fake_scope) = old_scope;
|
||||
|
||||
+1
-1
@@ -1463,7 +1463,7 @@ simple_list:
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_TYPE:
|
||||
switch (ast->attr) {
|
||||
switch (ast->attr & ~ZEND_TYPE_NULLABLE) {
|
||||
case IS_ARRAY: APPEND_STR("array");
|
||||
case IS_CALLABLE: APPEND_STR("callable");
|
||||
EMPTY_SWITCH_DEFAULT_CASE();
|
||||
|
||||
+17
-14
@@ -8549,25 +8549,28 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
case ZEND_AST_AND:
|
||||
case ZEND_AST_OR:
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i <= 1; i++) {
|
||||
zend_eval_const_expr(&ast->child[i]);
|
||||
if (ast->child[i]->kind == ZEND_AST_ZVAL) {
|
||||
if (zend_is_true(zend_ast_get_zval(ast->child[i])) == (ast->kind == ZEND_AST_OR)) {
|
||||
ZVAL_BOOL(&result, ast->kind == ZEND_AST_OR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
|
||||
zend_bool child0_is_true, child1_is_true;
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
if (ast->child[0]->kind != ZEND_AST_ZVAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
child0_is_true = zend_is_true(zend_ast_get_zval(ast->child[0]));
|
||||
if (child0_is_true == (ast->kind == ZEND_AST_OR)) {
|
||||
ZVAL_BOOL(&result, ast->kind == ZEND_AST_OR);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ast->child[1]->kind != ZEND_AST_ZVAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
child1_is_true = zend_is_true(zend_ast_get_zval(ast->child[1]));
|
||||
if (ast->kind == ZEND_AST_OR) {
|
||||
ZVAL_BOOL(&result, zend_is_true(zend_ast_get_zval(ast->child[0])) || zend_is_true(zend_ast_get_zval(ast->child[1])));
|
||||
ZVAL_BOOL(&result, child0_is_true || child1_is_true);
|
||||
} else {
|
||||
ZVAL_BOOL(&result, zend_is_true(zend_ast_get_zval(ast->child[0])) && zend_is_true(zend_ast_get_zval(ast->child[1])));
|
||||
ZVAL_BOOL(&result, child0_is_true && child1_is_true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -836,6 +836,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
|
||||
zend_string *lc_name;
|
||||
zend_fcall_info fcall_info;
|
||||
zend_fcall_info_cache fcall_cache;
|
||||
zend_class_entry *orig_fake_scope;
|
||||
|
||||
if (key) {
|
||||
lc_name = Z_STR_P(key);
|
||||
@@ -922,11 +923,14 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
|
||||
fcall_cache.called_scope = NULL;
|
||||
fcall_cache.object = NULL;
|
||||
|
||||
orig_fake_scope = EG(fake_scope);
|
||||
EG(fake_scope) = NULL;
|
||||
zend_exception_save();
|
||||
if ((zend_call_function(&fcall_info, &fcall_cache) == SUCCESS) && !EG(exception)) {
|
||||
ce = zend_hash_find_ptr(EG(class_table), lc_name);
|
||||
}
|
||||
zend_exception_restore();
|
||||
EG(fake_scope) = orig_fake_scope;
|
||||
|
||||
zval_ptr_dtor(&args[0]);
|
||||
zval_ptr_dtor_str(&fcall_info.function_name);
|
||||
|
||||
@@ -827,9 +827,10 @@ try_again:
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (generator == orig_generator) {
|
||||
zend_generator_close(generator, 0);
|
||||
if (EG(current_execute_data) &&
|
||||
EG(current_execute_data)->func &&
|
||||
ZEND_USER_CODE(EG(current_execute_data)->func->common.type)) {
|
||||
if (!EG(current_execute_data)) {
|
||||
zend_throw_exception_internal(NULL);
|
||||
} else if (EG(current_execute_data)->func &&
|
||||
ZEND_USER_CODE(EG(current_execute_data)->func->common.type)) {
|
||||
zend_rethrow_exception(EG(current_execute_data));
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1595,10 +1595,14 @@ static void zend_do_traits_property_binding(zend_class_entry *ce) /* {{{ */
|
||||
/* next: check for conflicts with current class */
|
||||
if ((coliding_prop = zend_hash_find_ptr(&ce->properties_info, prop_name)) != NULL) {
|
||||
if (coliding_prop->flags & ZEND_ACC_SHADOW) {
|
||||
zend_string_release_ex(coliding_prop->name, 0);
|
||||
if (coliding_prop->doc_comment) {
|
||||
zend_string_release_ex(coliding_prop->doc_comment, 0);
|
||||
}
|
||||
/* Only free if shadow is coming from direct parent,
|
||||
* otherwise these weren't copied in the first place. */
|
||||
if (coliding_prop->ce == ce->parent) {
|
||||
zend_string_release_ex(coliding_prop->name, 0);
|
||||
if (coliding_prop->doc_comment) {
|
||||
zend_string_release_ex(coliding_prop->doc_comment, 0);
|
||||
}
|
||||
}
|
||||
zend_hash_del(&ce->properties_info, prop_name);
|
||||
flags |= ZEND_ACC_CHANGED;
|
||||
} else {
|
||||
|
||||
@@ -310,7 +310,7 @@ static void zval_ini_dtor(zval *zv)
|
||||
%left '|' '&' '^'
|
||||
%right '~' '!'
|
||||
|
||||
%destructor { zval_ini_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL
|
||||
%destructor { zval_ini_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL cfg_var_ref constant_literal constant_string encapsed_list expr option_offset section_string_or_value string_or_value var_string_list var_string_list_section
|
||||
|
||||
%%
|
||||
|
||||
|
||||
+11
-5
@@ -741,8 +741,10 @@ ZEND_VM_COLD_CONST_HANDLER(13, ZEND_BOOL_NOT, CONST|TMPVAR|CV, ANY)
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -3342,11 +3344,11 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
call = NULL;
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
if (OP2_TYPE & (IS_VAR|IS_TMP_VAR)) {
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (call) {
|
||||
@@ -3358,8 +3360,6 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -3860,6 +3860,10 @@ ZEND_VM_HOT_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -4846,8 +4850,10 @@ ZEND_VM_COLD_CONST_HANDLER(52, ZEND_BOOL, CONST|TMPVAR|CV, ANY)
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
|
||||
+51
-13
@@ -2137,8 +2137,6 @@ try_function_name:
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -2313,11 +2311,11 @@ try_function_name:
|
||||
call = NULL;
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (call) {
|
||||
@@ -2329,8 +2327,6 @@ try_function_name:
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -2446,8 +2442,6 @@ try_function_name:
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -2485,8 +2479,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CON
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -2731,6 +2727,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -3056,8 +3056,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_H
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -12101,8 +12103,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_TMPVAR_HANDLER(Z
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -12363,8 +12367,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_TMPVAR_HANDLER(ZEND_
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -17663,6 +17669,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HA
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -20431,6 +20441,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HA
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -36411,8 +36425,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CV == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -36871,6 +36887,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HAN
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -37234,8 +37254,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCO
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CV == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -55708,6 +55730,10 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -57322,6 +57348,10 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -57608,6 +57638,10 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -59250,6 +59284,10 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
|
||||
+2
-2
@@ -107,8 +107,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=12
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=14
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
||||
@@ -57,9 +57,9 @@ bc_str2num (bc_num *num, char *str, int scale)
|
||||
zero_int = FALSE;
|
||||
if ( (*ptr == '+') || (*ptr == '-')) ptr++; /* Sign */
|
||||
while (*ptr == '0') ptr++; /* Skip leading zeros. */
|
||||
while (isdigit((int)*ptr)) ptr++, digits++; /* digits */
|
||||
while (*ptr >= '0' && *ptr <= '9') ptr++, digits++; /* digits */
|
||||
if (*ptr == '.') ptr++; /* decimal point */
|
||||
while (isdigit((int)*ptr)) ptr++, strscale++; /* digits */
|
||||
while (*ptr >= '0' && *ptr <= '9') ptr++, strscale++; /* digits */
|
||||
if ((*ptr != '\0') || (digits+strscale == 0))
|
||||
{
|
||||
*num = bc_copy_num (BCG(_zero_));
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #78878 (Buffer underflow in bc_shift_addsub)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
print @bcmul("\xB26483605105519922841849335928742092", bcpowmod(2, 65535, -4e-4));
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
+52
-1
@@ -1844,7 +1844,11 @@ static void curl_free_string(void **string)
|
||||
*/
|
||||
static void curl_free_post(void **post)
|
||||
{
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
curl_mime_free((curl_mime *)*post);
|
||||
#else
|
||||
curl_formfree((struct HttpPost *)*post);
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2764,16 +2768,30 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
HashTable *postfields;
|
||||
zend_string *string_key;
|
||||
zend_ulong num_key;
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
curl_mime *mime = NULL;
|
||||
curl_mimepart *part;
|
||||
CURLcode form_error;
|
||||
#else
|
||||
struct HttpPost *first = NULL;
|
||||
struct HttpPost *last = NULL;
|
||||
CURLFORMcode form_error;
|
||||
|
||||
#endif
|
||||
postfields = HASH_OF(zvalue);
|
||||
if (!postfields) {
|
||||
php_error_docref(NULL, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
if (zend_hash_num_elements(postfields) > 0) {
|
||||
mime = curl_mime_init(ch->cp);
|
||||
if (mime == NULL) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
ZEND_HASH_FOREACH_KEY_VAL(postfields, num_key, string_key, current) {
|
||||
zend_string *postval, *tmp_postval;
|
||||
/* Pretend we have a string_key here */
|
||||
@@ -2808,6 +2826,20 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
|
||||
filename = Z_STRVAL_P(prop);
|
||||
}
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
part = curl_mime_addpart(mime);
|
||||
if (part == NULL) {
|
||||
zend_string_release_ex(string_key, 0);
|
||||
return FAILURE;
|
||||
}
|
||||
if ((form_error = curl_mime_name(part, ZSTR_VAL(string_key))) != CURLE_OK
|
||||
|| (form_error = curl_mime_filedata(part, ZSTR_VAL(postval))) != CURLE_OK
|
||||
|| (form_error = curl_mime_filename(part, filename ? filename : ZSTR_VAL(postval))) != CURLE_OK
|
||||
|| (form_error = curl_mime_type(part, type ? type : "application/octet-stream")) != CURLE_OK) {
|
||||
error = form_error;
|
||||
}
|
||||
#else
|
||||
form_error = curl_formadd(&first, &last,
|
||||
CURLFORM_COPYNAME, ZSTR_VAL(string_key),
|
||||
CURLFORM_NAMELENGTH, ZSTR_LEN(string_key),
|
||||
@@ -2819,6 +2851,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
/* Not nice to convert between enums but we only have place for one error type */
|
||||
error = (CURLcode)form_error;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
zend_string_release_ex(string_key, 0);
|
||||
@@ -2827,6 +2860,18 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
|
||||
postval = zval_get_tmp_string(current, &tmp_postval);
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
part = curl_mime_addpart(mime);
|
||||
if (part == NULL) {
|
||||
zend_tmp_string_release(tmp_postval);
|
||||
zend_string_release_ex(string_key, 0);
|
||||
return FAILURE;
|
||||
}
|
||||
if ((form_error = curl_mime_name(part, ZSTR_VAL(string_key))) != CURLE_OK
|
||||
|| (form_error = curl_mime_data(part, ZSTR_VAL(postval), ZSTR_LEN(postval))) != CURLE_OK) {
|
||||
error = form_error;
|
||||
}
|
||||
#else
|
||||
/* The arguments after _NAMELENGTH and _CONTENTSLENGTH
|
||||
* must be explicitly cast to long in curl_formadd
|
||||
* use since curl needs a long not an int. */
|
||||
@@ -2841,6 +2886,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
/* Not nice to convert between enums but we only have place for one error type */
|
||||
error = (CURLcode)form_error;
|
||||
}
|
||||
#endif
|
||||
zend_tmp_string_release(tmp_postval);
|
||||
zend_string_release_ex(string_key, 0);
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
@@ -2853,8 +2899,13 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
if ((*ch->clone) == 1) {
|
||||
zend_llist_clean(&ch->to_free->post);
|
||||
}
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
zend_llist_add_element(&ch->to_free->post, &mime);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_MIMEPOST, mime);
|
||||
#else
|
||||
zend_llist_add_element(&ch->to_free->post, &first);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_HTTPPOST, first);
|
||||
#endif
|
||||
} else {
|
||||
#if LIBCURL_VERSION_NUM >= 0x071101
|
||||
zend_string *tmp_str;
|
||||
|
||||
@@ -3,6 +3,7 @@ Bug #78775: TLS issues from HTTP request affecting other encrypted connections
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) die('skip Requires curl');
|
||||
if (!extension_loaded('openssl')) die('skip Requires openssl');
|
||||
if (getenv('SKIP_ONLINE_TESTS')) die('skip Online test');
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Bug #79033 (Curl timeout error with specific url and post)
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
include 'server.inc';
|
||||
$host = curl_cli_server_start();
|
||||
$ch = curl_init();
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_URL => "{$host}/get.inc?test=post",
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_POSTFIELDS => [],
|
||||
CURLINFO_HEADER_OUT => true,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
]);
|
||||
var_dump(curl_exec($ch));
|
||||
var_dump(curl_getinfo($ch)["request_header"]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "array(0) {
|
||||
}
|
||||
"
|
||||
string(90) "POST /get.inc?test=post HTTP/1.1
|
||||
Host: localhost:%d
|
||||
Accept: */*
|
||||
Content-Length: 0
|
||||
|
||||
"
|
||||
+7
-5
@@ -4389,14 +4389,16 @@ static int php_date_interval_initialize_from_hash(zval **return_value, php_inter
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("h", h, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("i", i, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("s", s, timelib_sll, -1)
|
||||
do {
|
||||
{
|
||||
zval *z_arg = zend_hash_str_find(myht, "f", sizeof("f") - 1);
|
||||
(*intobj)->diff->us = -1000000;
|
||||
if (z_arg) {
|
||||
(*intobj)->diff->us = ((double)zval_get_double(z_arg) * 1000000);
|
||||
} else {
|
||||
(*intobj)->diff->us = (double) -1000000;
|
||||
double val = zval_get_double(z_arg) * 1000000;
|
||||
if (val >= 0 && val < 1000000) {
|
||||
(*intobj)->diff->us = val;
|
||||
}
|
||||
}
|
||||
} while (0);
|
||||
}
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("weekday", weekday, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("weekday_behavior", weekday_behavior, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("first_last_day_of", first_last_day_of, int, -1)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
--TEST--
|
||||
Bug #79015 (undefined-behavior in php_date.c)
|
||||
--FILE--
|
||||
<?php
|
||||
$payload = 'O:12:"DateInterval":16:{s:1:"y";i:1;s:1:"m";i:0;s:1:"d";i:4;s:1:"h";i:0;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";i:9999999999990;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";b:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}';
|
||||
var_dump(unserialize($payload));
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (16) {
|
||||
["y"]=>
|
||||
int(1)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(4)
|
||||
["h"]=>
|
||||
int(0)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["f"]=>
|
||||
float(-1)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
bool(false)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -43,10 +43,18 @@ DBA_OPEN_FUNC(lmdb)
|
||||
MDB_env *env;
|
||||
MDB_txn *txn;
|
||||
int rc, mode = 0644, flags = MDB_NOSUBDIR;
|
||||
zend_long mapsize = 0;
|
||||
|
||||
if(info->argc > 0) {
|
||||
mode = zval_get_long(&info->argv[0]);
|
||||
|
||||
if (info->argc > 1) {
|
||||
mapsize = zval_get_long(&info->argv[1]);
|
||||
if (mapsize < 0) {
|
||||
*error = "mapsize must be greater than or equal to zero";
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
/* TODO implement handling of the additional flags. */
|
||||
}
|
||||
|
||||
@@ -56,6 +64,14 @@ DBA_OPEN_FUNC(lmdb)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (mapsize > 0) {
|
||||
rc = mdb_env_set_mapsize(env, (size_t) mapsize);
|
||||
if (rc) {
|
||||
*error = mdb_strerror(rc);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
rc = mdb_env_open(env, info->path, flags, mode);
|
||||
if (rc) {
|
||||
*error = mdb_strerror(rc);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #78808 ([LMDB] MDB_MAP_FULL: Environment mapsize limit reached)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
$handler = 'lmdb';
|
||||
require_once __DIR__ .'/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$handler = 'lmdb';
|
||||
require_once __DIR__ .'/test.inc';
|
||||
$lmdb_h = dba_open($db_filename, 'c', 'lmdb', 0644, 5*1048576);
|
||||
for ($i = 0; $i < 50000; $i++) {
|
||||
dba_insert('key' . $i, 'value '. $i, $lmdb_h);
|
||||
}
|
||||
dba_close($lmdb_h);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once dirname(__FILE__) .'/clean.inc';
|
||||
?>
|
||||
+5
-3
@@ -3138,7 +3138,8 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
/*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s)", maker_note->make?maker_note->make:"");*/
|
||||
if (maker_note->make && (!ImageInfo->make || strcmp(maker_note->make, ImageInfo->make)))
|
||||
continue;
|
||||
if (maker_note->id_string && strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len))
|
||||
if (maker_note->id_string && value_len >= maker_note->id_string_len
|
||||
&& strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
@@ -3212,8 +3213,9 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
}
|
||||
|
||||
for (de=0;de<NumDirEntries;de++) {
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
|
||||
offset_base, data_len, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
size_t offset = 2 + 12 * de;
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + offset,
|
||||
offset_base, data_len - offset, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal f
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal pointer offset(x30303030 + x30303030 = x60606060 > x00EE) in %sbug76557.php on line %d
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal pointer offset(x30303030 + x30303030 = x60606060 > %s) in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): File structure corrupted in %sbug76557.php on line %d
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #78793: Use-after-free in exif parsing under memory sanitizer
|
||||
--FILE--
|
||||
<?php
|
||||
$f = "ext/exif/tests/bug77950.tiff";
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
@exif_read_data($f);
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #78910: Heap-buffer-overflow READ in exif (OSS-Fuzz #19044)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(exif_read_data('data:image/jpg;base64,TU0AKgAAAAwgICAgAAIBDwAEAAAAAgAAACKSfCAgAAAAAEZVSklGSUxN'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: exif_read_data(): Read from TIFF: tag(0x927C, MakerNote ): Illegal format code 0x2020, switching to BYTE in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): Process tag(x927C=MakerNote ): Illegal format code 0x2020, suppose BYTE in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): IFD data too short: 0x0000 offset 0x000C in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): Invalid TIFF file in %s on line %d
|
||||
bool(false)
|
||||
@@ -477,11 +477,9 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
|
||||
zend_string *repl;
|
||||
size_t rep_cnt = 0;
|
||||
|
||||
(void)setlocale(LC_CTYPE, "C");
|
||||
|
||||
opts |= PCRE2_MULTILINE;
|
||||
convert_libmagic_pattern(&patt, (char*)pat, strlen(pat), opts);
|
||||
if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) {
|
||||
if ((pce = pcre_get_compiled_regex_cache_ex(Z_STR(patt), 0)) == NULL) {
|
||||
zval_ptr_dtor(&patt);
|
||||
rep_cnt = -1;
|
||||
goto out;
|
||||
@@ -503,7 +501,6 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
|
||||
zend_string_release_ex(res, 0);
|
||||
|
||||
out:
|
||||
(void)setlocale(LC_CTYPE, "");
|
||||
return rep_cnt;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,14 +116,24 @@ cdf_app_to_mime(const char *vbuf, const struct nv *nv)
|
||||
{
|
||||
size_t i;
|
||||
const char *rv = NULL;
|
||||
char *vbuf_lower;
|
||||
|
||||
(void)setlocale(LC_CTYPE, "C");
|
||||
for (i = 0; nv[i].pattern != NULL; i++)
|
||||
if (strcasestr(vbuf, nv[i].pattern) != NULL) {
|
||||
vbuf_lower = zend_str_tolower_dup(vbuf, strlen(vbuf));
|
||||
for (i = 0; nv[i].pattern != NULL; i++) {
|
||||
char *pattern_lower;
|
||||
int found;
|
||||
|
||||
pattern_lower = zend_str_tolower_dup(nv[i].pattern, strlen(nv[i].pattern));
|
||||
found = (strstr(vbuf_lower, pattern_lower) != NULL);
|
||||
efree(pattern_lower);
|
||||
|
||||
if (found) {
|
||||
rv = nv[i].mime;
|
||||
break;
|
||||
}
|
||||
(void)setlocale(LC_CTYPE, "");
|
||||
}
|
||||
|
||||
efree(vbuf_lower);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
@@ -422,27 +422,25 @@ flush:
|
||||
private int
|
||||
check_fmt(struct magic_set *ms, const char *fmt)
|
||||
{
|
||||
pcre2_code *pce;
|
||||
uint32_t re_options, capture_count;
|
||||
pcre_cache_entry *pce;
|
||||
int rv = -1;
|
||||
zend_string *pattern;
|
||||
|
||||
if (strchr(fmt, '%') == NULL)
|
||||
return 0;
|
||||
|
||||
(void)setlocale(LC_CTYPE, "C");
|
||||
pattern = zend_string_init("~%[-0-9\\.]*s~", sizeof("~%[-0-9\\.]*s~") - 1, 0);
|
||||
if ((pce = pcre_get_compiled_regex(pattern, &capture_count, &re_options)) == NULL) {
|
||||
if ((pce = pcre_get_compiled_regex_cache_ex(pattern, 0)) == NULL) {
|
||||
rv = -1;
|
||||
} else {
|
||||
pcre2_match_data *match_data = php_pcre_create_match_data(capture_count, pce);
|
||||
pcre2_code *re = php_pcre_pce_re(pce);
|
||||
pcre2_match_data *match_data = php_pcre_create_match_data(0, re);
|
||||
if (match_data) {
|
||||
rv = pcre2_match(pce, (PCRE2_SPTR)fmt, strlen(fmt), 0, re_options, match_data, php_pcre_mctx()) > 0;
|
||||
rv = pcre2_match(re, (PCRE2_SPTR)fmt, strlen(fmt), 0, 0, match_data, php_pcre_mctx()) > 0;
|
||||
php_pcre_free_match_data(match_data);
|
||||
}
|
||||
}
|
||||
zend_string_release_ex(pattern, 0);
|
||||
(void)setlocale(LC_CTYPE, "");
|
||||
zend_string_release(pattern);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #74170 locale information change after mime_content_type
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!class_exists('finfo'))
|
||||
die('skip no fileinfo extension');
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (setlocale(LC_CTYPE, 'ru_RU.koi8r') === false)
|
||||
die('skip ru_RU.koi8r locale is not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(setlocale(LC_CTYPE, 'ru_RU.koi8r'));
|
||||
var_dump(nl_langinfo(CODESET));
|
||||
var_dump(mime_content_type(__DIR__ . '/resources/test.ppt'));
|
||||
var_dump(nl_langinfo(CODESET));
|
||||
--EXPECT--
|
||||
string(11) "ru_RU.koi8r"
|
||||
string(6) "KOI8-R"
|
||||
string(29) "application/vnd.ms-powerpoint"
|
||||
string(6) "KOI8-R"
|
||||
@@ -264,6 +264,7 @@ int gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, flo
|
||||
for ( y=0; y<src->sy; y++) {
|
||||
for(x=0; x<src->sx; x++) {
|
||||
new_r = new_g = new_b = 0;
|
||||
pxl = f(srcback, x, y);
|
||||
new_a = gdImageAlpha(srcback, pxl);
|
||||
|
||||
for (j=0; j<3; j++) {
|
||||
|
||||
@@ -534,7 +534,7 @@ compress(int init_bits, gdIOCtxPtr outfile, gdImagePtr im, GifCtx *ctx)
|
||||
output( (code_int)ctx->ClearCode, ctx );
|
||||
|
||||
#ifdef SIGNED_COMPARE_SLOW
|
||||
while ( (c = GIFNextPixel( im )) != (unsigned) EOF ) {
|
||||
while ( (c = GIFNextPixel( im, ctx )) != (unsigned) EOF ) {
|
||||
#else /*SIGNED_COMPARE_SLOW*/
|
||||
while ( (c = GIFNextPixel( im, ctx )) != EOF ) { /* } */
|
||||
#endif /*SIGNED_COMPARE_SLOW*/
|
||||
|
||||
@@ -2334,7 +2334,7 @@ int gdTransformAffineGetImage(gdImagePtr *dst,
|
||||
* src_area - Rectangular region to rotate in the src image
|
||||
*
|
||||
* Returns:
|
||||
* GD_TRUE if the affine is rectilinear or GD_FALSE
|
||||
* GD_TRUE on success or GD_FALSE on failure
|
||||
*/
|
||||
int gdTransformAffineCopy(gdImagePtr dst,
|
||||
int dst_x, int dst_y,
|
||||
@@ -2351,7 +2351,7 @@ int gdTransformAffineCopy(gdImagePtr dst,
|
||||
gdPointF pt, src_pt;
|
||||
gdRect bbox;
|
||||
int end_x, end_y;
|
||||
gdInterpolationMethod interpolation_id_bak = GD_DEFAULT;
|
||||
gdInterpolationMethod interpolation_id_bak = src->interpolation_id;
|
||||
interpolation_method interpolation_bak;
|
||||
|
||||
/* These methods use special implementations */
|
||||
@@ -2393,7 +2393,10 @@ int gdTransformAffineCopy(gdImagePtr dst,
|
||||
end_y = bbox.height + (int) fabs(bbox.y);
|
||||
|
||||
/* Get inverse affine to let us work with destination -> source */
|
||||
gdAffineInvert(inv, affine);
|
||||
if (gdAffineInvert(inv, affine) == GD_FALSE) {
|
||||
gdImageSetInterpolationMethod(src, interpolation_id_bak);
|
||||
return GD_FALSE;
|
||||
}
|
||||
|
||||
src_offset_x = src_region->x;
|
||||
src_offset_y = src_region->y;
|
||||
|
||||
@@ -55,7 +55,7 @@ int gdAffineApplyToPointF (gdPointFPtr dst, const gdPointFPtr src,
|
||||
* <gdAffineIdentity>
|
||||
*
|
||||
* Returns:
|
||||
* GD_TRUE if the affine is rectilinear or GD_FALSE
|
||||
* GD_TRUE on success or GD_FALSE on failure
|
||||
*/
|
||||
int gdAffineInvert (double dst[6], const double src[6])
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
--TEST--
|
||||
Bug #47946 (ImageConvolution overwrites background)
|
||||
--DESCRIPTION--
|
||||
The expected image has black pixel artifacts, what is another issue, though
|
||||
(perhaps #40158).
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 355 B |
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #79067 (gdTransformAffineCopy() may use unitialized values)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$matrix = [1, 1, 1, 1, 1, 1];
|
||||
$src = imagecreatetruecolor(8, 8);
|
||||
var_dump(imageaffine($src, $matrix));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #79068 (gdTransformAffineCopy() changes interpolation method)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/func.inc';
|
||||
|
||||
$src = imagecreatetruecolor(100, 100);
|
||||
imagefilledrectangle($src, 0, 0, 99, 99, 0xffffff);
|
||||
imageline($src, 10, 10, 90, 90, 0x000000);
|
||||
imagesetinterpolation($src, IMG_BSPLINE);
|
||||
imageaffine($src, [1, 1, 1, 1, 1, 1]);
|
||||
$dst = imagerotate($src, 80, 0xffffff);
|
||||
|
||||
test_image_equals_file(__DIR__ . '/bug79068.png', $dst);
|
||||
?>
|
||||
--EXPECT--
|
||||
The images are equal.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 798 B |
@@ -1285,7 +1285,7 @@ PHP_FUNCTION(locale_filter_matches)
|
||||
if( boolCanonical ){
|
||||
/* canonicalize loc_range */
|
||||
can_loc_range=get_icu_value_internal( loc_range , LOC_CANONICALIZE_TAG , &result , 0);
|
||||
if( result ==0) {
|
||||
if( result <=0) {
|
||||
intl_error_set( NULL, status,
|
||||
"locale_filter_matches : unable to canonicalize loc_range" , 0 );
|
||||
RETURN_FALSE;
|
||||
@@ -1293,7 +1293,7 @@ PHP_FUNCTION(locale_filter_matches)
|
||||
|
||||
/* canonicalize lang_tag */
|
||||
can_lang_tag = get_icu_value_internal( lang_tag , LOC_CANONICALIZE_TAG , &result , 0);
|
||||
if( result ==0) {
|
||||
if( result <=0) {
|
||||
intl_error_set( NULL, status,
|
||||
"locale_filter_matches : unable to canonicalize lang_tag" , 0 );
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #78804: Segmentation fault in Locale::filterMatches
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
if (Locale::filterMatches('en-US', 'und', true)) {
|
||||
echo 'Matches';
|
||||
} else {
|
||||
echo 'Not matches';
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Not matches
|
||||
@@ -358,6 +358,10 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
|
||||
context = php_stream_context_from_zval(Z_ISUNDEF(LIBXML(stream_context))? NULL : &LIBXML(stream_context), 0);
|
||||
|
||||
ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, REPORT_ERRORS, NULL, context);
|
||||
if (ret_val) {
|
||||
/* Prevent from closing this by fclose() */
|
||||
((php_stream*)ret_val)->flags |= PHP_STREAM_FLAG_NO_FCLOSE;
|
||||
}
|
||||
if (isescaped) {
|
||||
xmlFree(resolved_path);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,33 @@
|
||||
History
|
||||
|
||||
2019/11/29: Version 6.9.4
|
||||
|
||||
2019/11/22: Release Candidate 3 for Version 6.9.4
|
||||
|
||||
2019/11/20: fix a problem found by libFuzzer test
|
||||
2019/11/14: Release Candidate 2 for Version 6.9.4
|
||||
2019/11/12: fix integer overflow by nested quantifier
|
||||
2019/11/11: fix CVE-2019-19012: Integer overflow related to reg->dmax in search_in_range()
|
||||
2019/11/07: fix CVE-2019-19203: heap-buffer-overflow in gb18030_mbc_enc_len()
|
||||
2019/11/06: fix CVE-2019-19204: heap-buffer-overflow in fetch_interval_quantifier()
|
||||
2019/11/06: add HAVE_INTTYPES_H into config.h.windows.in and config.h.win{32,64}
|
||||
2019/11/06: add HAVE_STDINT_H into config.h.win{32,64}
|
||||
2019/11/05: Release Candidate 1 for Version 6.9.4
|
||||
2019/10/31: Update Unicode Emoji version to 12.1 (Nothing data changed)
|
||||
2019/10/29: implement USE_REPEAT_AND_EMPTY_CHECK_LOCAL_VAR configuration
|
||||
2019/10/18: re-implement case fold conversion
|
||||
2019/10/04: fix #156: Heap buffer overflow in match_at() with case-insensitive match
|
||||
2019/09/30: NEW API: add onig_regset_replace()
|
||||
2019/09/30: change Unicode VERSION value format
|
||||
2019/09/20: NEW API: add regset functions
|
||||
2019/09/20: add data ensure check before peek string value in OP_PUSH_IF_PEEK_NEXT
|
||||
2019/09/20: fix loose code in encode-harness.c
|
||||
2019/08/13: fix heap-buffer-overflow
|
||||
2019/08/13: Add a macro to disable direct threading in the match engine (PR#149)
|
||||
|
||||
2019/08/06: Version 6.9.3 (secirity fix release)
|
||||
|
||||
2019/07/30: add ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE
|
||||
2019/07/30: add ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE_IN_CC
|
||||
2019/07/29: add STK_PREC_READ_START/END stack type
|
||||
2019/07/29: Fix #147: Stack Exhaustion Problem caused by some parsing functions
|
||||
2019/07/11: add a dictionary file for libfuzzer
|
||||
|
||||
@@ -27,25 +27,34 @@ Supported character encodings:
|
||||
* doc/SYNTAX.md: contributed by seanofw
|
||||
|
||||
|
||||
Version 6.9.4
|
||||
-------------
|
||||
|
||||
* NEW API: RegSet (set of regexes)
|
||||
* Fixed CVE-2019-19012
|
||||
* Fixed CVE-2019-19203 (Does not affect UTF-8, UTF-16 and UTF-32 encodings)
|
||||
* Fixed CVE-2019-19204 (Affects only PosixBasic, Emacs and Grep syntaxes)
|
||||
* Fixed CVE-2019-19246
|
||||
* Fixed some problems (found by libFuzzer test)
|
||||
|
||||
|
||||
Version 6.9.3 (security fix release)
|
||||
------------------------------------
|
||||
|
||||
* Fixed CVE-2019-13224
|
||||
* Fixed CVE-2019-13225
|
||||
* Fixed many problems (found by libfuzzer programs)
|
||||
* Fixed CVE-2019-16163
|
||||
* Fixed many problems (found by libFuzzer test)
|
||||
|
||||
|
||||
Version 6.9.2 (Reiwa)
|
||||
---------------------
|
||||
|
||||
* add doc/SYNTAX.md
|
||||
* Direct threaded code (for GCC and Clang)
|
||||
* Update Unicode version 12.1.0
|
||||
* NEW: Unicode Text Segment mode option (?y{g}) (?y{w}) (*original)
|
||||
|
||||
g: Extended Grapheme Cluster mode / w: Word mode
|
||||
|
||||
(Unicode Standard Annex #29 [http://unicode.org/reports/tr29/])
|
||||
|
||||
|
||||
Version 6.9.1
|
||||
-------------
|
||||
@@ -118,7 +127,7 @@ Version 6.5.0
|
||||
* NEW: \O (true anychar)
|
||||
* NEW: if-then-else (?(...)...\|...)
|
||||
* NEW: Backreference validity checker (?(xxx)) (*original)
|
||||
* NEW: Absent repeater (?~absent) \[is equal to (?\~\|absent|\O*)]
|
||||
* NEW: Absent repeater (?~absent) \[is equal to (?\~\|(?:absent)|\O*)]
|
||||
* NEW: Absent expression (?~|absent|expr) (*original)
|
||||
* NEW: Absent stopper (?~|absent) (*original)
|
||||
|
||||
@@ -244,15 +253,18 @@ Sample Programs
|
||||
|
||||
|File |Description |
|
||||
|:---------------------|:-----------------------------------------|
|
||||
|sample/callout.c |example of callouts |
|
||||
|sample/count.c |example of built-in callout *COUNT |
|
||||
|sample/echo.c |example of user defined callouts of name |
|
||||
|sample/encode.c |example of some encodings |
|
||||
|sample/listcap.c |example of the capture history |
|
||||
|sample/names.c |example of the named group callback |
|
||||
|sample/posix.c |POSIX API sample |
|
||||
|sample/regset.c |example of using RegSet API |
|
||||
|sample/scan.c |example of using onig_scan() |
|
||||
|sample/simple.c |example of the minimum (Oniguruma API) |
|
||||
|sample/names.c |example of the named group callback. |
|
||||
|sample/encode.c |example of some encodings. |
|
||||
|sample/listcap.c |example of the capture history. |
|
||||
|sample/posix.c |POSIX API sample. |
|
||||
|sample/scan.c |example of using onig_scan(). |
|
||||
|sample/sql.c |example of the variable meta characters. |
|
||||
|sample/user_property.c|example of user defined Unicode property. |
|
||||
|sample/callout.c |example of callouts. |
|
||||
|sample/sql.c |example of the variable meta characters |
|
||||
|sample/user_property.c|example of user defined Unicode property |
|
||||
|
||||
|
||||
Test Programs
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Oniguruma API Version 6.9.3 2019/07/06
|
||||
Oniguruma API Version 6.9.4 2019/09/30
|
||||
|
||||
#include <oniguruma.h>
|
||||
|
||||
@@ -168,7 +168,7 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
|
||||
OnigCompileInfo* ci, OnigErrorInfo* einfo)
|
||||
|
||||
This function is deprecate, and it does not allow the case where
|
||||
This function is deprecated, and it does not allow the case where
|
||||
the encoding of pattern and target is different.
|
||||
|
||||
Create a regex object.
|
||||
@@ -306,6 +306,7 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
|
||||
normal return: match position offset (i.e. p - str >= 0)
|
||||
not found: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 reg: regex object
|
||||
@@ -342,7 +343,8 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
Do not pass invalid byte string in the regex character encoding.
|
||||
|
||||
normal return: match length (>= 0)
|
||||
not match: ONIG_MISMATCH ( < 0)
|
||||
not match: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 reg: regex object
|
||||
@@ -391,6 +393,136 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
7 callback_arg: optional argument passed to callback
|
||||
|
||||
|
||||
# int onig_regset_new(OnigRegSet** rset, int n, regex_t* regs[])
|
||||
|
||||
Create a regset object.
|
||||
All regex objects must have the same character encoding.
|
||||
All regex objects are prohibited from having the ONIG_OPTION_FIND_LONGEST option.
|
||||
|
||||
arguments
|
||||
1 rset: return address of regset object
|
||||
2 n: number of regex in regs
|
||||
3 regs: array of regex
|
||||
|
||||
normal return: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_add(OnigRegSet* set, regex_t* reg)
|
||||
|
||||
Add a regex into regset.
|
||||
The regex object must have the same character encoding with the regset.
|
||||
The regex object is prohibited from having the ONIG_OPTION_FIND_LONGEST option.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 reg: regex object
|
||||
|
||||
normal return: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_replace(OnigRegSet* set, int at, regex_t* reg)
|
||||
|
||||
Replace a regex in regset with another one.
|
||||
If the reg argument value is NULL, then remove at-th regex. (and indexes of other regexes are changed)
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 at: index of regex (zero origin)
|
||||
3 reg: regex object
|
||||
|
||||
normal return: ONIG_NORMAL
|
||||
|
||||
|
||||
# void onig_regset_free(OnigRegSet* set)
|
||||
|
||||
Free memory used by regset object and regex objects in the regset.
|
||||
If the same regex object is registered twice, the situation becomes destructive.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
|
||||
|
||||
# int onig_regset_number_of_regex(OnigRegSet* set)
|
||||
|
||||
Returns number of regex objects in the regset.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
|
||||
|
||||
# regex_t* onig_regset_get_regex(OnigRegSet* set, int at)
|
||||
|
||||
Returns the regex object corresponding to the at-th regex.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 at: index of regex array (zero origin)
|
||||
|
||||
|
||||
# OnigRegion* onig_regset_get_region(OnigRegSet* set, int at)
|
||||
|
||||
Returns the region object corresponding to the at-th regex.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 at: index of regex array (zero origin)
|
||||
|
||||
|
||||
# int onig_regset_search(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, int* rmatch_pos)
|
||||
|
||||
Perform a search with regset.
|
||||
|
||||
return value:
|
||||
normal return: index of match regex (zero origin)
|
||||
not found: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 str: target string
|
||||
3 end: terminate address of target string
|
||||
4 start: search start address of target string
|
||||
5 range: search terminate address of target string
|
||||
6 lead: outer loop element
|
||||
ONIG_REGSET_POSITION_LEAD (returns most left position)
|
||||
ONIG_REGSET_REGEX_LEAD (returns most left position)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex)
|
||||
7 option: search time option
|
||||
ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line
|
||||
ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line
|
||||
8 rmatch_pos: return address of match position (match_address - str)
|
||||
|
||||
* ONIG_REGSET_POSITION_LEAD and ONIG_REGSET_REGEX_LEAD return the same result.
|
||||
These differences only appear in search time.
|
||||
In most cases, ONIG_REGSET_POSITION_LEAD seems to be faster.
|
||||
|
||||
|
||||
# int onig_regset_search_with_param(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, OnigMatchParam* mps[], int* rmatch_pos)
|
||||
|
||||
Perform a search with regset and match-params.
|
||||
|
||||
return value:
|
||||
normal return: index of match regex (zero origin)
|
||||
not found: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 str: target string
|
||||
3 end: terminate address of target string
|
||||
4 start: search start address of target string
|
||||
5 range: search terminate address of target string
|
||||
6 lead: outer loop element
|
||||
ONIG_REGSET_POSITION_LEAD (returns most left position)
|
||||
ONIG_REGSET_REGEX_LEAD (returns most left position)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex)
|
||||
7 option: search time option
|
||||
ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line
|
||||
ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line
|
||||
8 mps: array of match-params
|
||||
9 rmatch_pos: return address of match position (match_address - str)
|
||||
|
||||
|
||||
# OnigRegion* onig_region_new(void)
|
||||
|
||||
Create a region.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
鬼車インターフェース Version 6.9.3 2019/07/06
|
||||
鬼車インターフェース Version 6.9.4 2019/09/30
|
||||
|
||||
#include <oniguruma.h>
|
||||
|
||||
@@ -390,6 +390,138 @@
|
||||
7 callback_arg: コールバック関数に渡される付加引数値
|
||||
|
||||
|
||||
# int onig_regset_new(OnigRegSet** rset, int n, regex_t* regs[])
|
||||
|
||||
regsetオブジェクトを生成する。
|
||||
全ての正規表現オブジェクトは、同じ文字エンコーディングでなければならない。
|
||||
全ての正規表現オブジェクトは、ONIG_OPTION_FIND_LONGESTオプションでコンパイルされていてはならない。
|
||||
|
||||
引数
|
||||
1 rset: regsetオブジェクトを返すためのアドレス
|
||||
2 n: 正規表現の個数
|
||||
3 regs: 正規表現オブジェクトの配列
|
||||
|
||||
正常終了戻り値: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_add(OnigRegSet* set, regex_t* reg)
|
||||
|
||||
regsetオブジェクトに正規表現を追加する。
|
||||
正規表現オブジェクトは、regsetと同じ文字エンコーディングでなければならない。
|
||||
正規表現オブジェクトは、ONIG_OPTION_FIND_LONGESTオプションでコンパイルされていてはならない。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 reg: 正規表現オブジェクト
|
||||
|
||||
正常終了戻り値: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_replace(OnigRegSet* set, int at, regex_t* reg)
|
||||
|
||||
regsetの中の一個の正規表現オブジェクトを別のものに変更する。
|
||||
若しreg引数の値がNULLであれば、at番目の正規表現オブジェクトを外す。(そして、以降の正規表現オブジェクトのインデックスは変化する)
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 at: 変更する場所のインデックス
|
||||
2 reg: 正規表現オブジェクト
|
||||
|
||||
正常終了戻り値: ONIG_NORMAL
|
||||
|
||||
|
||||
# void onig_regset_free(OnigRegSet* set)
|
||||
|
||||
regsetオブジェクトとその中の正規表現オブジェクトの使用メモリを開放する。
|
||||
若し、同一の正規表現オブジェクトを重複して登録していれば、破壊的な状況になる。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
|
||||
|
||||
# int onig_regset_number_of_regex(OnigRegSet* set)
|
||||
|
||||
regsetの中の正規表現オブジェクトの個数を返す。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
|
||||
|
||||
# regex_t* onig_regset_get_regex(OnigRegSet* set, int at)
|
||||
|
||||
regsetのat番目の正規表現を返す。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 at: 正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
|
||||
|
||||
# OnigRegion* onig_regset_get_region(OnigRegSet* set, int at)
|
||||
|
||||
regsetのat番目の正規表現に対応する領域を返す。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 at: 正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
|
||||
|
||||
# int onig_regset_search(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, int* rmatch_pos)
|
||||
|
||||
regsetによる検索を実行する。
|
||||
|
||||
戻り値:
|
||||
検索成功: マッチした正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
検索失敗: ONIG_MISMATCH (< 0)
|
||||
エラー: エラーコード (< 0)
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 str: 検索対象文字列
|
||||
3 end: 検索対象文字列の終端アドレス
|
||||
4 start: 検索対象文字列の検索先頭位置アドレス
|
||||
5 range: 検索対象文字列の検索終了位置アドレス
|
||||
(start <= 探索される文字列 < range)
|
||||
6 lead: 外側のループ要素
|
||||
ONIG_REGSET_POSITION_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_REGEX_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (最初にマッチした正規表現の結果を返す)
|
||||
7 option: 検索時オプション
|
||||
ONIG_OPTION_NOTBOL 文字列の先頭(str)を行頭と看做さない
|
||||
ONIG_OPTION_NOTEOL 文字列の終端(end)を行末と看做さない
|
||||
8 rmatch_pos: マッチした位置を返すためのアドレス (match_address - str)
|
||||
|
||||
* ONIG_REGSET_POSITION_LEADとONIG_REGSET_REGEX_LEADは同じ結果を返す。
|
||||
これらの違いは検索時間にしか現れない。
|
||||
ほとんどの場合、ONIG_REGSET_POSITION_LEADのほうが速いと思われる。
|
||||
|
||||
|
||||
# int onig_regset_search_with_param(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, OnigMatchParam* mps[], int* rmatch_pos)
|
||||
|
||||
regsetとOnigMatchParamオブジェクトによる検索を実行する。
|
||||
|
||||
戻り値:
|
||||
検索成功: マッチした正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
検索失敗: ONIG_MISMATCH (< 0)
|
||||
エラー: エラーコード (< 0)
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 str: 検索対象文字列
|
||||
3 end: 検索対象文字列の終端アドレス
|
||||
4 start: 検索対象文字列の検索先頭位置アドレス
|
||||
5 range: 検索対象文字列の検索終了位置アドレス
|
||||
(start <= 探索される文字列 < range)
|
||||
6 lead: 外側のループ要素
|
||||
ONIG_REGSET_POSITION_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_REGEX_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (最初にマッチした正規表現の結果を返す)
|
||||
7 option: 検索時オプション
|
||||
ONIG_OPTION_NOTBOL 文字列の先頭(str)を行頭と看做さない
|
||||
ONIG_OPTION_NOTEOL 文字列の終端(end)を行末と看做さない
|
||||
8 mps: OnigMatchParamオブジェクトの配列
|
||||
9 rmatch_pos: マッチした位置を返すためのアドレス (match_address - str)
|
||||
|
||||
|
||||
# OnigRegion* onig_region_new(void)
|
||||
|
||||
マッチ領域情報(region)を作成する。
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Oniguruma Regular Expressions Version 6.9.2 2019/03/29
|
||||
Oniguruma Regular Expressions Version 6.9.4 2019/10/31
|
||||
|
||||
syntax: ONIG_SYNTAX_ONIGURUMA (default)
|
||||
|
||||
@@ -289,6 +289,11 @@ syntax: ONIG_SYNTAX_ONIGURUMA (default)
|
||||
In negative look-behind, capturing group isn't allowed,
|
||||
but non-capturing group (?:) is allowed.
|
||||
|
||||
* In look-behind and negative look-behind, support for
|
||||
ignore-case option is limited. Only supports conversion
|
||||
between single characters. (Does not support conversion
|
||||
of multiple characters in Unicode)
|
||||
|
||||
(?>subexp) atomic group
|
||||
no backtracks in subexp.
|
||||
|
||||
@@ -338,7 +343,7 @@ syntax: ONIG_SYNTAX_ONIGURUMA (default)
|
||||
This works like .* (more precisely \O*), but it is
|
||||
limited by the range that does not include the string
|
||||
match with <absent>.
|
||||
This is a written abbreviation of (?~|absent|\O*).
|
||||
This is a written abbreviation of (?~|(?:absent)|\O*).
|
||||
\O* is used as a repeater.
|
||||
|
||||
(?~|absent|exp) Absent expression (* original)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
鬼車 正規表現 Version 6.9.2 2019/03/29
|
||||
鬼車 正規表現 Version 6.9.4 2019/10/31
|
||||
|
||||
使用文法: ONIG_SYNTAX_ONIGURUMA (既定値)
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
\f 改頁 (0x0C)
|
||||
\a 鐘 (0x07)
|
||||
\e 退避修飾 (0x1B)
|
||||
\nnn 八進数表現 符号化バイト値(の一部)
|
||||
\nnn 八進数表現 符号化バイト値
|
||||
\o{17777777777} 拡張八進数表現 コードポイント値
|
||||
\uHHHH 拡張十六進数表現 コードポイント値
|
||||
\xHH 十六進数表現 符号化バイト値(の一部)
|
||||
\xHH 十六進数表現 符号化バイト値
|
||||
\x{7HHHHHHH} 拡張十六進数表現 コードポイント値
|
||||
\cx 制御文字表現 コードポイント値
|
||||
\C-x 制御文字表現 コードポイント値
|
||||
@@ -284,6 +284,10 @@
|
||||
否定戻り読みでは、捕獲式集合は許されないが、
|
||||
非捕獲式集合は許される。
|
||||
|
||||
* 戻り読み、否定戻り読みの中では、ignore-caseオプションの
|
||||
対応が制限される。一文字と一文字の間の変換しか対応しない。
|
||||
(Unicodeでの複数文字の変換に対応しない)
|
||||
|
||||
(?>式) 原子的式集合
|
||||
式全体を通過したとき、式の中での後退再試行を行なわない
|
||||
|
||||
@@ -334,20 +338,20 @@
|
||||
|
||||
<不在機能群>
|
||||
|
||||
(?~不在式) 不在繰り返し (*原案 田中哲)
|
||||
これは .*(より正確には\O*)のように動作するが、<不在式>に
|
||||
(?~不在) 不在繰り返し (*原案 田中哲)
|
||||
これは .*(より正確には\O*)のように動作するが、<不在>に
|
||||
適合する文字列を含まない範囲に制限される。
|
||||
これは(?~|不在式|\O*)の省略表記である。
|
||||
これは(?~|(?:不在)|\O*)の省略表記である。
|
||||
|
||||
(?~|不在式|式) 不在式 (* 原作)
|
||||
これは<式>のように動作するが、<不在式>に適合する文字列を
|
||||
(?~|不在|式) 不在式 (* 原作)
|
||||
これは<式>のように動作するが、<不在>に適合する文字列を
|
||||
含まない範囲に制限される。
|
||||
|
||||
例 (?~|345|\d*) "12345678" ==> "12", "1", ""
|
||||
|
||||
(?~|不在式) 不在停止 (* 原作)
|
||||
(?~|不在) 不在停止 (* 原作)
|
||||
この演算子を通過した後は、対象文字列の適合範囲が
|
||||
<不在式>に適合する文字列を含まない範囲に制限される。
|
||||
<不在>に適合する文字列を含まない範囲に制限される。
|
||||
|
||||
(?~|) 範囲消去
|
||||
不在停止の効果を消して、それ以前の状態にする。
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
# Oniguruma syntax (operator) configuration
|
||||
|
||||
_Documented for Oniguruma 6.9.2 (2019/03/28)_
|
||||
_Documented for Oniguruma 6.9.3 (2019/08/08)_
|
||||
|
||||
|
||||
----------
|
||||
@@ -960,6 +960,12 @@ _Set in: Ruby, Oniguruma_
|
||||
If this flag is set, Oniguruma will warn about nested repeat operators those have no meaning, like `(?:a*)+`.
|
||||
If this flag is clear, Oniguruma will allow the nested repeat operators without warning about them.
|
||||
|
||||
### 26. ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE_IN_CC (allow [a-\x{7fffffff}])
|
||||
|
||||
_Set in: Oniguruma_
|
||||
|
||||
If this flag is set, then invalid code points at the end of range in character class are allowed.
|
||||
|
||||
### 31. ONIG_SYN_CONTEXT_INDEP_ANCHORS
|
||||
|
||||
_Set in: PosixExtended, GnuRegex, Java, Perl, Perl_NG, Ruby, Oniguruma_
|
||||
@@ -1066,4 +1072,5 @@ These tables show which of the built-in syntaxes use which flags and options, fo
|
||||
| 23 | `ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC` | - | Yes | - | - | Yes | Yes | Yes | Yes | Yes | Yes |
|
||||
| 24 | `ONIG_SYN_WARN_CC_OP_NOT_ESCAPED` | - | - | - | - | - | - | - | - | Yes | Yes |
|
||||
| 25 | `ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT` | - | - | - | - | - | - | - | - | Yes | Yes |
|
||||
| 26 | `ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE_IN_CC` | - | - | - | - | - | - | - | - | - | Yes |
|
||||
| 31 | `ONIG_SYN_CONTEXT_INDEP_ANCHORS` | - | Yes | - | - | Yes | Yes | Yes | Yes | Yes | Yes |
|
||||
@@ -1,4 +1,4 @@
|
||||
Unicode Properties (from Unicode Version: 12.1.0)
|
||||
Unicode Properties (Unicode Version: 12.1.0, Emoji: 12.1)
|
||||
|
||||
15: ASCII_Hex_Digit
|
||||
16: Adlam
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
ascii.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
big5.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,6 +54,16 @@ big5_mbc_enc_len(const UChar* p)
|
||||
return EncLen_BIG5[*p];
|
||||
}
|
||||
|
||||
static int
|
||||
big5_code_to_mbclen(OnigCodePoint code)
|
||||
{
|
||||
if ((code & (~0xffff)) != 0) return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
if ((code & 0xff00) != 0) return 2;
|
||||
if (EncLen_BIG5[(int )(code & 0xff)] == 1) return 1;
|
||||
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
}
|
||||
|
||||
static int
|
||||
is_valid_mbc_string(const UChar* p, const UChar* end)
|
||||
{
|
||||
@@ -99,15 +109,6 @@ big5_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
|
||||
pp, end, lower);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
big5_is_mbc_ambiguous(OnigCaseFoldType flag,
|
||||
const UChar** pp, const UChar* end)
|
||||
{
|
||||
return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_BIG5, flag, pp, end);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
big5_is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
@@ -174,7 +175,7 @@ OnigEncodingType OnigEncodingBIG5 = {
|
||||
1, /* min enc length */
|
||||
onigenc_is_mbc_newline_0x0a,
|
||||
big5_mbc_to_code,
|
||||
onigenc_mb2_code_to_mbclen,
|
||||
big5_code_to_mbclen,
|
||||
big5_code_to_mbc,
|
||||
big5_mbc_case_fold,
|
||||
onigenc_ascii_apply_all_case_fold,
|
||||
|
||||
@@ -1,82 +1,56 @@
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_FLOAT_H 1
|
||||
#define HAVE_OFF_T 1
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_SHORT 2
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF___INT64 8
|
||||
#define SIZEOF_OFF_T 4
|
||||
#define SIZEOF_VOIDP 4
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_SIZE_T 4
|
||||
#define HAVE_PROTOTYPES 1
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#define HAVE_STDARG_PROTOTYPES 1
|
||||
#ifndef NORETURN
|
||||
#if _MSC_VER > 1100
|
||||
#define NORETURN(x) __declspec(noreturn) x
|
||||
#else
|
||||
#define NORETURN(x) x
|
||||
#endif
|
||||
#endif
|
||||
#define HAVE_DECL_SYS_NERR 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define uid_t int
|
||||
#define gid_t int
|
||||
#define GETGROUPS_T int
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_DUP2 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MKDIR 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_STRERROR 1
|
||||
#define HAVE_STRFTIME 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FREXP 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_MODF 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_CHSIZE 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE__SETJMP 1
|
||||
#define HAVE_TELLDIR 1
|
||||
#define HAVE_SEEKDIR 1
|
||||
#define HAVE_MKTIME 1
|
||||
#define HAVE_COSH 1
|
||||
#define HAVE_SINH 1
|
||||
#define HAVE_TANH 1
|
||||
#define HAVE_EXECVE 1
|
||||
#define HAVE_TZNAME 1
|
||||
#define HAVE_DAYLIGHT 1
|
||||
#define SETPGRP_VOID 1
|
||||
#define inline __inline
|
||||
#define NEED_IO_SEEK_BETWEEN_RW 1
|
||||
#define RSHIFT(x,y) ((x)>>(int)y)
|
||||
#define FILE_COUNT _cnt
|
||||
#define FILE_READPTR _ptr
|
||||
#define DEFAULT_KCODE KCODE_NONE
|
||||
#define DLEXT ".so"
|
||||
#define DLEXT2 ".dll"
|
||||
#if defined(__MINGW32__) || _MSC_VER >= 1600
|
||||
#define HAVE_STDINT_H 1
|
||||
#endif
|
||||
#if defined(__MINGW32__) || _MSC_VER >= 1800
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#endif
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_OFF_T 1
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF___INT64 8
|
||||
#define SIZEOF_OFF_T 4
|
||||
#define SIZEOF_VOIDP 4
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_SIZE_T 4
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#ifndef NORETURN
|
||||
#if _MSC_VER > 1100
|
||||
#define NORETURN(x) __declspec(noreturn) x
|
||||
#else
|
||||
#define NORETURN(x) x
|
||||
#endif
|
||||
#endif
|
||||
#define HAVE_DECL_SYS_NERR 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define uid_t int
|
||||
#define gid_t int
|
||||
#define GETGROUPS_T int
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_DUP2 1
|
||||
#define HAVE_MKDIR 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_CHSIZE 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE_TELLDIR 1
|
||||
#define HAVE_SEEKDIR 1
|
||||
#define HAVE_EXECVE 1
|
||||
#define HAVE_DAYLIGHT 1
|
||||
#define SETPGRP_VOID 1
|
||||
#define inline __inline
|
||||
#define NEED_IO_SEEK_BETWEEN_RW 1
|
||||
#define RSHIFT(x,y) ((x)>>(int)y)
|
||||
#define FILE_COUNT _cnt
|
||||
#define FILE_READPTR _ptr
|
||||
#define DEFAULT_KCODE KCODE_NONE
|
||||
#define DLEXT ".so"
|
||||
#define DLEXT2 ".dll"
|
||||
@@ -1,82 +1,56 @@
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_FLOAT_H 1
|
||||
#define HAVE_OFF_T 1
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_SHORT 2
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF___INT64 8
|
||||
#define SIZEOF_OFF_T 4
|
||||
#define SIZEOF_VOIDP 8
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_SIZE_T 8
|
||||
#define HAVE_PROTOTYPES 1
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#define HAVE_STDARG_PROTOTYPES 1
|
||||
#ifndef NORETURN
|
||||
#if _MSC_VER > 1100
|
||||
#define NORETURN(x) __declspec(noreturn) x
|
||||
#else
|
||||
#define NORETURN(x) x
|
||||
#endif
|
||||
#endif
|
||||
#define HAVE_DECL_SYS_NERR 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define uid_t int
|
||||
#define gid_t int
|
||||
#define GETGROUPS_T int
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_DUP2 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MKDIR 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_STRERROR 1
|
||||
#define HAVE_STRFTIME 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FREXP 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_MODF 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_CHSIZE 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE__SETJMP 1
|
||||
#define HAVE_TELLDIR 1
|
||||
#define HAVE_SEEKDIR 1
|
||||
#define HAVE_MKTIME 1
|
||||
#define HAVE_COSH 1
|
||||
#define HAVE_SINH 1
|
||||
#define HAVE_TANH 1
|
||||
#define HAVE_EXECVE 1
|
||||
#define HAVE_TZNAME 1
|
||||
#define HAVE_DAYLIGHT 1
|
||||
#define SETPGRP_VOID 1
|
||||
#define inline __inline
|
||||
#define NEED_IO_SEEK_BETWEEN_RW 1
|
||||
#define RSHIFT(x,y) ((x)>>(int)y)
|
||||
#define FILE_COUNT _cnt
|
||||
#define FILE_READPTR _ptr
|
||||
#define DEFAULT_KCODE KCODE_NONE
|
||||
#define DLEXT ".so"
|
||||
#define DLEXT2 ".dll"
|
||||
#if defined(__MINGW32__) || _MSC_VER >= 1600
|
||||
#define HAVE_STDINT_H 1
|
||||
#endif
|
||||
#if defined(__MINGW32__) || _MSC_VER >= 1800
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#endif
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_OFF_T 1
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF___INT64 8
|
||||
#define SIZEOF_OFF_T 4
|
||||
#define SIZEOF_VOIDP 8
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_SIZE_T 8
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#ifndef NORETURN
|
||||
#if _MSC_VER > 1100
|
||||
#define NORETURN(x) __declspec(noreturn) x
|
||||
#else
|
||||
#define NORETURN(x) x
|
||||
#endif
|
||||
#endif
|
||||
#define HAVE_DECL_SYS_NERR 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define uid_t int
|
||||
#define gid_t int
|
||||
#define GETGROUPS_T int
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_DUP2 1
|
||||
#define HAVE_MKDIR 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_CHSIZE 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE_TELLDIR 1
|
||||
#define HAVE_SEEKDIR 1
|
||||
#define HAVE_EXECVE 1
|
||||
#define HAVE_DAYLIGHT 1
|
||||
#define SETPGRP_VOID 1
|
||||
#define inline __inline
|
||||
#define NEED_IO_SEEK_BETWEEN_RW 1
|
||||
#define RSHIFT(x,y) ((x)>>(int)y)
|
||||
#define FILE_COUNT _cnt
|
||||
#define FILE_READPTR _ptr
|
||||
#define DEFAULT_KCODE KCODE_NONE
|
||||
#define DLEXT ".so"
|
||||
#define DLEXT2 ".dll"
|
||||
@@ -2,8 +2,8 @@
|
||||
cp1251.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2006-2018 Byte <byte AT mail DOT kna DOT ru>
|
||||
* K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2006-2019 Byte <byte AT mail DOT kna DOT ru>
|
||||
* K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
euc_jp.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -120,25 +120,6 @@ code_to_mbclen(OnigCodePoint code)
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
code_to_mbc_first(OnigCodePoint code)
|
||||
{
|
||||
int first;
|
||||
|
||||
if ((code & 0xff0000) != 0) {
|
||||
first = (code >> 16) & 0xff;
|
||||
}
|
||||
else if ((code & 0xff00) != 0) {
|
||||
first = (code >> 8) & 0xff;
|
||||
}
|
||||
else {
|
||||
return (int )code;
|
||||
}
|
||||
return first;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
code_to_mbc(OnigCodePoint code, UChar *buf)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* ANSI-C code produced by gperf version 3.1 */
|
||||
/* Command-line: /usr/local/bin/gperf -pt -T -L ANSI-C -N onigenc_euc_jp_lookup_property_name --output-file gperf1.tmp euc_jp_prop.gperf */
|
||||
/* Command-line: gperf -pt -T -L ANSI-C -N onigenc_euc_jp_lookup_property_name --output-file gperf1.tmp euc_jp_prop.gperf */
|
||||
/* Computed positions: -k'1,3' */
|
||||
|
||||
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
euc_kr.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,6 +54,16 @@ euckr_mbc_enc_len(const UChar* p)
|
||||
return EncLen_EUCKR[*p];
|
||||
}
|
||||
|
||||
static int
|
||||
euckr_code_to_mbclen(OnigCodePoint code)
|
||||
{
|
||||
if ((code & (~0xffff)) != 0) return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
if ((code & 0xff00) != 0) return 2;
|
||||
if (EncLen_EUCKR[(int )(code & 0xff)] == 1) return 1;
|
||||
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
}
|
||||
|
||||
static int
|
||||
is_valid_mbc_string(const UChar* p, const UChar* end)
|
||||
{
|
||||
@@ -98,15 +108,6 @@ euckr_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
|
||||
pp, end, lower);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
euckr_is_mbc_ambiguous(OnigCaseFoldType flag,
|
||||
const UChar** pp, const UChar* end)
|
||||
{
|
||||
return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_EUC_KR, flag, pp, end);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
euckr_is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
@@ -149,7 +150,7 @@ OnigEncodingType OnigEncodingEUC_KR = {
|
||||
1, /* min enc length */
|
||||
onigenc_is_mbc_newline_0x0a,
|
||||
euckr_mbc_to_code,
|
||||
onigenc_mb2_code_to_mbclen,
|
||||
euckr_code_to_mbclen,
|
||||
euckr_code_to_mbc,
|
||||
euckr_mbc_case_fold,
|
||||
onigenc_ascii_apply_all_case_fold,
|
||||
@@ -174,7 +175,7 @@ OnigEncodingType OnigEncodingEUC_CN = {
|
||||
1, /* min enc length */
|
||||
onigenc_is_mbc_newline_0x0a,
|
||||
euckr_mbc_to_code,
|
||||
onigenc_mb2_code_to_mbclen,
|
||||
euckr_code_to_mbclen,
|
||||
euckr_code_to_mbc,
|
||||
euckr_mbc_case_fold,
|
||||
onigenc_ascii_apply_all_case_fold,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
euc_tw.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,6 +54,20 @@ euctw_mbc_enc_len(const UChar* p)
|
||||
return EncLen_EUCTW[*p];
|
||||
}
|
||||
|
||||
static int
|
||||
euctw_code_to_mbclen(OnigCodePoint code)
|
||||
{
|
||||
if ((code & 0xff000000) != 0) return 4;
|
||||
else if ((code & 0xff0000) != 0) return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
else if ((code & 0xff00) != 0) return 2;
|
||||
else {
|
||||
if (EncLen_EUCTW[(int )(code & 0xff)] == 1)
|
||||
return 1;
|
||||
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
is_valid_mbc_string(const UChar* p, const UChar* end)
|
||||
{
|
||||
@@ -155,7 +169,7 @@ OnigEncodingType OnigEncodingEUC_TW = {
|
||||
1, /* min enc length */
|
||||
onigenc_is_mbc_newline_0x0a,
|
||||
euctw_mbc_to_code,
|
||||
onigenc_mb4_code_to_mbclen,
|
||||
euctw_code_to_mbclen,
|
||||
euctw_code_to_mbc,
|
||||
euctw_mbc_case_fold,
|
||||
onigenc_ascii_apply_all_case_fold,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2005-2019 KUBO Takehiro <kubo AT jiubao DOT org>
|
||||
* K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -33,6 +33,7 @@
|
||||
#if 1
|
||||
#define DEBUG_GB18030(arg)
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define DEBUG_GB18030(arg) printf arg
|
||||
#endif
|
||||
|
||||
@@ -75,6 +76,20 @@ gb18030_mbc_enc_len(const UChar* p)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int
|
||||
gb18030_code_to_mbclen(OnigCodePoint code)
|
||||
{
|
||||
if ((code & 0xff000000) != 0) return 4;
|
||||
else if ((code & 0xff0000) != 0) return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
else if ((code & 0xff00) != 0) return 2;
|
||||
else {
|
||||
if (GB18030_MAP[(int )(code & 0xff)] == CM)
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
is_valid_mbc_string(const UChar* p, const UChar* end)
|
||||
{
|
||||
@@ -135,15 +150,6 @@ gb18030_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
|
||||
pp, end, lower);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
gb18030_is_mbc_ambiguous(OnigCaseFoldType flag,
|
||||
const UChar** pp, const UChar* end)
|
||||
{
|
||||
return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_GB18030, flag, pp, end);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
gb18030_is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
@@ -522,7 +528,7 @@ OnigEncodingType OnigEncodingGB18030 = {
|
||||
1, /* min enc length */
|
||||
onigenc_is_mbc_newline_0x0a,
|
||||
gb18030_mbc_to_code,
|
||||
onigenc_mb4_code_to_mbclen,
|
||||
gb18030_code_to_mbclen,
|
||||
gb18030_code_to_mbc,
|
||||
gb18030_mbc_case_fold,
|
||||
onigenc_ascii_apply_all_case_fold,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_1.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -216,32 +216,6 @@ mbc_case_fold(OnigCaseFoldType flag, const UChar** pp,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_1_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
/* 0xdf, 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */
|
||||
if (*p >= 0xaa && *p <= 0xba)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_10.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -121,28 +121,6 @@ mbc_case_fold(OnigCaseFoldType flag,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_10_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_11.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_13.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -121,32 +121,6 @@ mbc_case_fold(OnigCaseFoldType flag,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_13_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
/* 0xdf, 0xb5 are lower case letter, but can't convert. */
|
||||
if (*p == 0xb5)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_14.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -121,29 +121,6 @@ mbc_case_fold(OnigCaseFoldType flag,
|
||||
return 1; /* return byte length of converted char to lower */
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag,
|
||||
const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_14_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_15.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -121,32 +121,6 @@ mbc_case_fold(OnigCaseFoldType flag,
|
||||
return 1; /* return byte length of converted char to lower */
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_15_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
/* 0xdf etc.. are lower case letter, but can't convert. */
|
||||
if (*p == 0xaa || *p == 0xb5 || *p == 0xba)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_16.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -121,28 +121,6 @@ mbc_case_fold(OnigCaseFoldType flag,
|
||||
return 1; /* return byte length of converted char to lower */
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_16_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_2.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -121,28 +121,6 @@ mbc_case_fold(OnigCaseFoldType flag,
|
||||
return 1; /* return byte length of converted char to lower */
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_2_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static const OnigPairCaseFoldCodes CaseFoldMap[] = {
|
||||
{ 0xa1, 0xb1 },
|
||||
{ 0xa3, 0xb3 },
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_3.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -121,32 +121,6 @@ mbc_case_fold(OnigCaseFoldType flag, const UChar** pp,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_3_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
/* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */
|
||||
if (*p == 0xb5)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_4.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -121,31 +121,6 @@ mbc_case_fold(OnigCaseFoldType flag,
|
||||
return 1; /* return byte length of converted char to lower */
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_4_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
if (*p == 0xa2)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_5.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -114,19 +114,6 @@ mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_5_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_6.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_7.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -114,26 +114,6 @@ mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_7_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
if (*p == 0xc0 || *p == 0xe0)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_8.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_9.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -121,32 +121,6 @@ mbc_case_fold(OnigCaseFoldType flag,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_9_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
/* 0xdf etc.. are lower case letter, but can't convert. */
|
||||
if (*p >= 0xaa && *p <= 0xba)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
koi8.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -115,25 +115,6 @@ koi8_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
koi8_is_mbc_ambiguous(OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end)
|
||||
{
|
||||
const OnigUChar* p = *pp;
|
||||
|
||||
(*pp)++;
|
||||
if (((flag & ONIGENC_CASE_FOLD_ASCII_CASE) != 0 &&
|
||||
ONIGENC_IS_MBC_ASCII(p)) ||
|
||||
((flag & ONIGENC_CASE_FOLD_NONASCII_CASE) != 0 &&
|
||||
!ONIGENC_IS_MBC_ASCII(p))) {
|
||||
int v = (EncKOI8_CtypeTable[*p] &
|
||||
(BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
koi8_is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
koi8_r.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -114,19 +114,6 @@ koi8_r_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
koi8_r_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
(*pp)++;
|
||||
v = (EncKOI8_R_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
koi8_r_is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
mktable.c
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2019 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
onig_init.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2016-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2016-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
oniggnu.h - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
onigposix.h - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -95,6 +95,7 @@ typedef struct {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONIG_STATIC
|
||||
#ifndef ONIG_EXTERN
|
||||
#if defined(_WIN32) && !defined(__GNUC__)
|
||||
#if defined(ONIGURUMA_EXPORT)
|
||||
@@ -108,6 +109,9 @@ typedef struct {
|
||||
#ifndef ONIG_EXTERN
|
||||
#define ONIG_EXTERN extern
|
||||
#endif
|
||||
#else
|
||||
#define ONIG_EXTERN extern
|
||||
#endif
|
||||
|
||||
#ifndef ONIGURUMA_H
|
||||
typedef unsigned int OnigOptionType;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
oniguruma.h - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2019 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -36,9 +36,9 @@ extern "C" {
|
||||
#define ONIGURUMA
|
||||
#define ONIGURUMA_VERSION_MAJOR 6
|
||||
#define ONIGURUMA_VERSION_MINOR 9
|
||||
#define ONIGURUMA_VERSION_TEENY 3
|
||||
#define ONIGURUMA_VERSION_TEENY 4
|
||||
|
||||
#define ONIGURUMA_VERSION_INT 60903
|
||||
#define ONIGURUMA_VERSION_INT 60904
|
||||
|
||||
#ifndef P_
|
||||
#if defined(__STDC__) || defined(_WIN32)
|
||||
@@ -687,6 +687,14 @@ typedef OnigRegexType* OnigRegex;
|
||||
typedef OnigRegexType regex_t;
|
||||
#endif
|
||||
|
||||
struct OnigRegSetStruct;
|
||||
typedef struct OnigRegSetStruct OnigRegSet;
|
||||
|
||||
typedef enum {
|
||||
ONIG_REGSET_POSITION_LEAD = 0,
|
||||
ONIG_REGSET_REGEX_LEAD = 1,
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER = 2
|
||||
} OnigRegSetLead;
|
||||
|
||||
typedef struct {
|
||||
int num_of_elements;
|
||||
@@ -797,6 +805,26 @@ ONIG_EXTERN
|
||||
int onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
|
||||
ONIG_EXTERN
|
||||
int onig_match_with_param P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option, OnigMatchParam* mp));
|
||||
|
||||
ONIG_EXTERN
|
||||
int onig_regset_new P_((OnigRegSet** rset, int n, regex_t* regs[]));
|
||||
ONIG_EXTERN
|
||||
int onig_regset_add P_((OnigRegSet* set, regex_t* reg));
|
||||
ONIG_EXTERN
|
||||
int onig_regset_replace P_((OnigRegSet* set, int at, regex_t* reg));
|
||||
ONIG_EXTERN
|
||||
void onig_regset_free P_((OnigRegSet* set));
|
||||
ONIG_EXTERN
|
||||
int onig_regset_number_of_regex P_((OnigRegSet* set));
|
||||
ONIG_EXTERN
|
||||
regex_t* onig_regset_get_regex P_((OnigRegSet* set, int at));
|
||||
ONIG_EXTERN
|
||||
OnigRegion* onig_regset_get_region P_((OnigRegSet* set, int at));
|
||||
ONIG_EXTERN
|
||||
int onig_regset_search P_((OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, int* rmatch_pos));
|
||||
ONIG_EXTERN
|
||||
int onig_regset_search_with_param P_((OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, OnigMatchParam* mps[], int* rmatch_pos));
|
||||
|
||||
ONIG_EXTERN
|
||||
OnigRegion* onig_region_new P_((void));
|
||||
ONIG_EXTERN
|
||||
|
||||
+1174
-745
File diff suppressed because it is too large.
Load diff
@@ -2,7 +2,7 @@
|
||||
regenc.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2019 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -182,7 +182,8 @@ onigenc_get_right_adjust_char_head_with_prev(OnigEncoding enc,
|
||||
p += enclen(enc, p);
|
||||
}
|
||||
else {
|
||||
if (prev) *prev = (const UChar* )NULL; /* Sorry */
|
||||
if (prev)
|
||||
*prev = onigenc_get_prev_char_head(enc, start, p);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
@@ -208,20 +209,6 @@ onigenc_step_back(OnigEncoding enc, const UChar* start, const UChar* s, int n)
|
||||
return (UChar* )s;
|
||||
}
|
||||
|
||||
#if 0
|
||||
extern int
|
||||
onigenc_mbc_enc_len_end(OnigEncoding enc, const UChar* p, const UChar* end)
|
||||
{
|
||||
int len;
|
||||
int n;
|
||||
|
||||
len = ONIGENC_MBC_ENC_LEN(enc, p);
|
||||
n = (int )(end - p);
|
||||
|
||||
return (n < len ? n : len);
|
||||
}
|
||||
#endif
|
||||
|
||||
extern UChar*
|
||||
onigenc_step(OnigEncoding enc, const UChar* p, const UChar* end, int n)
|
||||
{
|
||||
@@ -705,18 +692,6 @@ onigenc_ascii_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED, const UChar** p,
|
||||
return 1; /* return byte length of converted char to lower */
|
||||
}
|
||||
|
||||
#if 0
|
||||
extern int
|
||||
onigenc_ascii_is_mbc_ambiguous(OnigCaseFoldType flag,
|
||||
const UChar** pp, const UChar* end)
|
||||
{
|
||||
const UChar* p = *pp;
|
||||
|
||||
(*pp)++;
|
||||
return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p);
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int
|
||||
onigenc_single_byte_mbc_enc_len(const UChar* p ARG_UNUSED)
|
||||
{
|
||||
@@ -833,41 +808,6 @@ onigenc_mbn_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag ARG_UNUSED,
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
extern int
|
||||
onigenc_mbn_is_mbc_ambiguous(OnigEncoding enc, OnigCaseFoldType flag,
|
||||
const UChar** pp, const UChar* end)
|
||||
{
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (ONIGENC_IS_MBC_ASCII(p)) {
|
||||
(*pp)++;
|
||||
return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p);
|
||||
}
|
||||
|
||||
(*pp) += enclen(enc, p);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int
|
||||
onigenc_mb2_code_to_mbclen(OnigCodePoint code)
|
||||
{
|
||||
if ((code & (~0xffff)) != 0) return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
|
||||
if ((code & 0xff00) != 0) return 2;
|
||||
else return 1;
|
||||
}
|
||||
|
||||
extern int
|
||||
onigenc_mb4_code_to_mbclen(OnigCodePoint code)
|
||||
{
|
||||
if ((code & 0xff000000) != 0) return 4;
|
||||
else if ((code & 0xff0000) != 0) return 3;
|
||||
else if ((code & 0xff00) != 0) return 2;
|
||||
else return 1;
|
||||
}
|
||||
|
||||
extern int
|
||||
onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
regenc.h - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2019 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -163,13 +163,11 @@ extern int onigenc_length_check_is_valid_mbc_string P_((OnigEncoding enc, const
|
||||
/* methods for multi byte encoding */
|
||||
extern OnigCodePoint onigenc_mbn_mbc_to_code P_((OnigEncoding enc, const UChar* p, const UChar* end));
|
||||
extern int onigenc_mbn_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower));
|
||||
extern int onigenc_mb2_code_to_mbclen P_((OnigCodePoint code));
|
||||
extern int onigenc_mb2_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
|
||||
extern int onigenc_minimum_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));
|
||||
extern int onigenc_unicode_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));
|
||||
extern int onigenc_is_mbc_word_ascii P_((OnigEncoding enc, UChar* s, const UChar* end));
|
||||
extern int onigenc_mb2_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
|
||||
extern int onigenc_mb4_code_to_mbclen P_((OnigCodePoint code));
|
||||
extern int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
|
||||
extern int onigenc_mb4_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
|
||||
extern struct PropertyNameCtype* onigenc_euc_jp_lookup_property_name P_((register const char *str, register size_t len));
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
regerror.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2019 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+1229
-594
File diff suppressed because it is too large.
Load diff
@@ -2,7 +2,7 @@
|
||||
regext.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2019 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -41,7 +41,6 @@ conv_ext0be32(const UChar* s, const UChar* end, UChar* conv)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
conv_ext0le32(const UChar* s, const UChar* end, UChar* conv)
|
||||
{
|
||||
@@ -92,7 +91,6 @@ conv_swap2bytes(const UChar* s, const UChar* end, UChar* conv)
|
||||
s += 2;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
conv_encoding(OnigEncoding from, OnigEncoding to, const UChar* s, const UChar* end,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
reggnu.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2019 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+138
-224
@@ -4,7 +4,7 @@
|
||||
regint.h - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2019 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -47,16 +47,11 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
|
||||
(defined(__ppc__) && defined(__APPLE__)) || \
|
||||
defined(__x86_64) || defined(__x86_64__) || \
|
||||
defined(__mc68020__)
|
||||
#define PLATFORM_UNALIGNED_WORD_ACCESS
|
||||
#endif
|
||||
|
||||
#ifndef ONIG_DISABLE_DIRECT_THREADING
|
||||
#ifdef __GNUC__
|
||||
#define USE_GOTO_LABELS_AS_VALUES
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* config */
|
||||
/* spec. config */
|
||||
@@ -82,6 +77,8 @@
|
||||
#define USE_VARIABLE_META_CHARS
|
||||
#define USE_POSIX_API_REGION_OPTION
|
||||
#define USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
|
||||
/* #define USE_REPEAT_AND_EMPTY_CHECK_LOCAL_VAR */
|
||||
|
||||
|
||||
#include "regenc.h"
|
||||
|
||||
@@ -197,49 +194,16 @@ typedef unsigned int uintptr_t;
|
||||
#define CHAR_MAP_SIZE 256
|
||||
#define INFINITE_LEN ONIG_INFINITE_DISTANCE
|
||||
|
||||
#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
|
||||
|
||||
#define PLATFORM_GET_INC(val,p,type) do{\
|
||||
val = *(type* )p;\
|
||||
(p) += sizeof(type);\
|
||||
} while(0)
|
||||
|
||||
#else
|
||||
|
||||
#define PLATFORM_GET_INC(val,p,type) do{\
|
||||
xmemcpy(&val, (p), sizeof(type));\
|
||||
(p) += sizeof(type);\
|
||||
} while(0)
|
||||
|
||||
/* sizeof(OnigCodePoint) */
|
||||
#ifdef SIZEOF_SIZE_T
|
||||
# define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T
|
||||
#else
|
||||
# define WORD_ALIGNMENT_SIZE SIZEOF_LONG
|
||||
#endif
|
||||
|
||||
#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
|
||||
(pad_size) = WORD_ALIGNMENT_SIZE - ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\
|
||||
if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\
|
||||
} while (0)
|
||||
|
||||
#define ALIGNMENT_RIGHT(addr) do {\
|
||||
(addr) += (WORD_ALIGNMENT_SIZE - 1);\
|
||||
(addr) -= ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\
|
||||
} while (0)
|
||||
|
||||
#endif /* PLATFORM_UNALIGNED_WORD_ACCESS */
|
||||
|
||||
|
||||
#ifdef USE_CALLOUT
|
||||
|
||||
typedef struct {
|
||||
int flag;
|
||||
OnigCalloutOf of;
|
||||
int in;
|
||||
int name_id;
|
||||
const UChar* tag_start;
|
||||
const UChar* tag_end;
|
||||
int flag;
|
||||
OnigCalloutOf of;
|
||||
int in;
|
||||
int name_id;
|
||||
const UChar* tag_start;
|
||||
const UChar* tag_end;
|
||||
OnigCalloutType type;
|
||||
OnigCalloutFunc start_func;
|
||||
OnigCalloutFunc end_func;
|
||||
@@ -272,7 +236,6 @@ enum OptimizeType {
|
||||
OPTIMIZE_STR, /* Slow Search */
|
||||
OPTIMIZE_STR_FAST, /* Sunday quick search / BMH */
|
||||
OPTIMIZE_STR_FAST_STEP_FORWARD, /* Sunday quick search / BMH */
|
||||
OPTIMIZE_STR_CASE_FOLD_FAST, /* Sunday quick search / BMH (ignore case) */
|
||||
OPTIMIZE_STR_CASE_FOLD, /* Slow Search (ignore case) */
|
||||
OPTIMIZE_MAP /* char map */
|
||||
};
|
||||
@@ -288,6 +251,8 @@ typedef unsigned int MemStatusType;
|
||||
#define MEM_STATUS_AT0(stats,n) \
|
||||
((n) > 0 && (n) < (int )MEM_STATUS_BITS_NUM ? ((stats) & ((MemStatusType )1 << n)) : ((stats) & 1))
|
||||
|
||||
#define MEM_STATUS_IS_ALL_ON(stats) (((stats) & 1) != 0)
|
||||
|
||||
#define MEM_STATUS_ON(stats,n) do {\
|
||||
if ((n) < (int )MEM_STATUS_BITS_NUM) {\
|
||||
if ((n) != 0)\
|
||||
@@ -302,8 +267,14 @@ typedef unsigned int MemStatusType;
|
||||
(stats) |= ((MemStatusType )1 << (n));\
|
||||
} while (0)
|
||||
|
||||
#define MEM_STATUS_LIMIT_AT(stats,n) \
|
||||
((n) < (int )MEM_STATUS_BITS_NUM ? ((stats) & ((MemStatusType )1 << n)) : 0)
|
||||
#define MEM_STATUS_LIMIT_ON(stats,n) do {\
|
||||
if ((n) < (int )MEM_STATUS_BITS_NUM && (n) != 0) {\
|
||||
(stats) |= ((MemStatusType )1 << (n));\
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
#define INT_MAX_LIMIT ((1UL << (SIZEOF_INT * 8 - 1)) - 1)
|
||||
|
||||
#define IS_CODE_WORD_ASCII(enc,code) \
|
||||
(ONIGENC_IS_CODE_ASCII(code) && ONIGENC_IS_CODE_WORD(enc,code))
|
||||
@@ -354,16 +325,12 @@ typedef unsigned int MemStatusType;
|
||||
/* bitset */
|
||||
#define BITS_PER_BYTE 8
|
||||
#define SINGLE_BYTE_SIZE (1 << BITS_PER_BYTE)
|
||||
#define BITS_IN_ROOM (sizeof(Bits) * BITS_PER_BYTE)
|
||||
#define BITS_IN_ROOM 32 /* 4 * BITS_PER_BYTE */
|
||||
#define BITSET_SIZE (SINGLE_BYTE_SIZE / BITS_IN_ROOM)
|
||||
|
||||
#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
|
||||
typedef unsigned int Bits;
|
||||
#else
|
||||
typedef unsigned char Bits;
|
||||
#endif
|
||||
typedef Bits BitSet[BITSET_SIZE];
|
||||
typedef Bits* BitSetRef;
|
||||
typedef uint32_t Bits;
|
||||
typedef Bits BitSet[BITSET_SIZE];
|
||||
typedef Bits* BitSetRef;
|
||||
|
||||
#define SIZE_BITSET sizeof(BitSet)
|
||||
|
||||
@@ -372,8 +339,8 @@ typedef Bits* BitSetRef;
|
||||
for (i = 0; i < (int )BITSET_SIZE; i++) { (bs)[i] = 0; } \
|
||||
} while (0)
|
||||
|
||||
#define BS_ROOM(bs,pos) (bs)[pos / BITS_IN_ROOM]
|
||||
#define BS_BIT(pos) (1 << (pos % BITS_IN_ROOM))
|
||||
#define BS_ROOM(bs,pos) (bs)[(unsigned int )(pos) >> 5]
|
||||
#define BS_BIT(pos) (1u << ((unsigned int )(pos) & 0x1f))
|
||||
|
||||
#define BITSET_AT(bs, pos) (BS_ROOM(bs,pos) & BS_BIT(pos))
|
||||
#define BITSET_SET_BIT(bs, pos) BS_ROOM(bs,pos) |= BS_BIT(pos)
|
||||
@@ -389,11 +356,13 @@ typedef struct _BBuf {
|
||||
|
||||
#define BB_INIT(buf,size) bbuf_init((BBuf* )(buf), (size))
|
||||
|
||||
/*
|
||||
#define BB_SIZE_INC(buf,inc) do{\
|
||||
(buf)->alloc += (inc);\
|
||||
(buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\
|
||||
if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\
|
||||
} while (0)
|
||||
*/
|
||||
|
||||
#define BB_EXPAND(buf,low) do{\
|
||||
do { (buf)->alloc *= 2; } while ((buf)->alloc < (unsigned int )low);\
|
||||
@@ -491,39 +460,34 @@ typedef struct _BBuf {
|
||||
|
||||
/* operation code */
|
||||
enum OpCode {
|
||||
OP_FINISH = 0, /* matching process terminator (no more alternative) */
|
||||
OP_END = 1, /* pattern code terminator (success end) */
|
||||
|
||||
OP_EXACT1 = 2, /* single byte, N = 1 */
|
||||
OP_EXACT2, /* single byte, N = 2 */
|
||||
OP_EXACT3, /* single byte, N = 3 */
|
||||
OP_EXACT4, /* single byte, N = 4 */
|
||||
OP_EXACT5, /* single byte, N = 5 */
|
||||
OP_EXACTN, /* single byte */
|
||||
OP_EXACTMB2N1, /* mb-length = 2 N = 1 */
|
||||
OP_EXACTMB2N2, /* mb-length = 2 N = 2 */
|
||||
OP_EXACTMB2N3, /* mb-length = 2 N = 3 */
|
||||
OP_EXACTMB2N, /* mb-length = 2 */
|
||||
OP_EXACTMB3N, /* mb-length = 3 */
|
||||
OP_EXACTMBN, /* other length */
|
||||
|
||||
OP_EXACT1_IC, /* single byte, N = 1, ignore case */
|
||||
OP_EXACTN_IC, /* single byte, ignore case */
|
||||
|
||||
OP_FINISH = 0, /* matching process terminator (no more alternative) */
|
||||
OP_END = 1, /* pattern code terminator (success end) */
|
||||
OP_STR_1 = 2, /* single byte, N = 1 */
|
||||
OP_STR_2, /* single byte, N = 2 */
|
||||
OP_STR_3, /* single byte, N = 3 */
|
||||
OP_STR_4, /* single byte, N = 4 */
|
||||
OP_STR_5, /* single byte, N = 5 */
|
||||
OP_STR_N, /* single byte */
|
||||
OP_STR_MB2N1, /* mb-length = 2 N = 1 */
|
||||
OP_STR_MB2N2, /* mb-length = 2 N = 2 */
|
||||
OP_STR_MB2N3, /* mb-length = 2 N = 3 */
|
||||
OP_STR_MB2N, /* mb-length = 2 */
|
||||
OP_STR_MB3N, /* mb-length = 3 */
|
||||
OP_STR_MBN, /* other length */
|
||||
OP_STR_1_IC, /* single byte, N = 1, ignore case */
|
||||
OP_STR_N_IC, /* single byte, ignore case */
|
||||
OP_CCLASS,
|
||||
OP_CCLASS_MB,
|
||||
OP_CCLASS_MIX,
|
||||
OP_CCLASS_NOT,
|
||||
OP_CCLASS_MB_NOT,
|
||||
OP_CCLASS_MIX_NOT,
|
||||
|
||||
OP_ANYCHAR, /* "." */
|
||||
OP_ANYCHAR_ML, /* "." multi-line */
|
||||
OP_ANYCHAR_STAR, /* ".*" */
|
||||
OP_ANYCHAR_ML_STAR, /* ".*" multi-line */
|
||||
OP_ANYCHAR_STAR_PEEK_NEXT,
|
||||
OP_ANYCHAR_ML_STAR_PEEK_NEXT,
|
||||
|
||||
OP_WORD,
|
||||
OP_WORD_ASCII,
|
||||
OP_NO_WORD,
|
||||
@@ -532,16 +496,13 @@ enum OpCode {
|
||||
OP_NO_WORD_BOUNDARY,
|
||||
OP_WORD_BEGIN,
|
||||
OP_WORD_END,
|
||||
|
||||
OP_TEXT_SEGMENT_BOUNDARY,
|
||||
|
||||
OP_BEGIN_BUF,
|
||||
OP_END_BUF,
|
||||
OP_BEGIN_LINE,
|
||||
OP_END_LINE,
|
||||
OP_SEMI_END_BUF,
|
||||
OP_BEGIN_POSITION,
|
||||
|
||||
OP_BACKREF1,
|
||||
OP_BACKREF2,
|
||||
OP_BACKREF_N,
|
||||
@@ -552,34 +513,35 @@ enum OpCode {
|
||||
OP_BACKREF_WITH_LEVEL_IC, /* \k<xxx+n>, \k<xxx-n> */
|
||||
OP_BACKREF_CHECK, /* (?(n)), (?('name')) */
|
||||
OP_BACKREF_CHECK_WITH_LEVEL, /* (?(n-level)), (?('name-level')) */
|
||||
|
||||
OP_MEMORY_START,
|
||||
OP_MEMORY_START_PUSH, /* push back-tracker to stack */
|
||||
OP_MEMORY_END_PUSH, /* push back-tracker to stack */
|
||||
OP_MEMORY_END_PUSH_REC, /* push back-tracker to stack */
|
||||
OP_MEMORY_END,
|
||||
OP_MEMORY_END_REC, /* push marker to stack */
|
||||
|
||||
OP_MEM_START,
|
||||
OP_MEM_START_PUSH, /* push back-tracker to stack */
|
||||
OP_MEM_END_PUSH, /* push back-tracker to stack */
|
||||
#ifdef USE_CALL
|
||||
OP_MEM_END_PUSH_REC, /* push back-tracker to stack */
|
||||
#endif
|
||||
OP_MEM_END,
|
||||
#ifdef USE_CALL
|
||||
OP_MEM_END_REC, /* push marker to stack */
|
||||
#endif
|
||||
OP_FAIL, /* pop stack and move */
|
||||
OP_JUMP,
|
||||
OP_PUSH,
|
||||
OP_PUSH_SUPER,
|
||||
OP_POP_OUT,
|
||||
#ifdef USE_OP_PUSH_OR_JUMP_EXACT
|
||||
OP_PUSH_OR_JUMP_EXACT1, /* if match exact then push, else jump. */
|
||||
OP_PUSH_OR_JUMP_EXACT1, /* if match exact then push, else jump. */
|
||||
#endif
|
||||
OP_PUSH_IF_PEEK_NEXT, /* if match exact then push, else none. */
|
||||
OP_REPEAT, /* {n,m} */
|
||||
OP_REPEAT_NG, /* {n,m}? (non greedy) */
|
||||
OP_PUSH_IF_PEEK_NEXT, /* if match exact then push, else none. */
|
||||
OP_REPEAT, /* {n,m} */
|
||||
OP_REPEAT_NG, /* {n,m}? (non greedy) */
|
||||
OP_REPEAT_INC,
|
||||
OP_REPEAT_INC_NG, /* non greedy */
|
||||
OP_REPEAT_INC_SG, /* search and get in stack */
|
||||
OP_REPEAT_INC_NG_SG, /* search and get in stack (non greedy) */
|
||||
OP_REPEAT_INC_NG, /* non greedy */
|
||||
OP_EMPTY_CHECK_START, /* null loop checker start */
|
||||
OP_EMPTY_CHECK_END, /* null loop checker end */
|
||||
OP_EMPTY_CHECK_END_MEMST, /* null loop checker end (with capture status) */
|
||||
#ifdef USE_CALL
|
||||
OP_EMPTY_CHECK_END_MEMST_PUSH, /* with capture status and push check-end */
|
||||
|
||||
#endif
|
||||
OP_PREC_READ_START, /* (?=...) start */
|
||||
OP_PREC_READ_END, /* (?=...) end */
|
||||
OP_PREC_READ_NOT_START, /* (?!...) start */
|
||||
@@ -589,11 +551,12 @@ enum OpCode {
|
||||
OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */
|
||||
OP_LOOK_BEHIND_NOT_START, /* (?<!...) start */
|
||||
OP_LOOK_BEHIND_NOT_END, /* (?<!...) end */
|
||||
|
||||
OP_CALL, /* \g<name> */
|
||||
OP_RETURN,
|
||||
OP_PUSH_SAVE_VAL,
|
||||
OP_UPDATE_VAR,
|
||||
#ifdef USE_CALL
|
||||
OP_CALL, /* \g<name> */
|
||||
OP_RETURN,
|
||||
#endif
|
||||
#ifdef USE_CALLOUT
|
||||
OP_CALLOUT_CONTENTS, /* (?{...}) (?{{...}}) */
|
||||
OP_CALLOUT_NAME, /* (*name) (*name[tag](args...)) */
|
||||
@@ -601,8 +564,8 @@ enum OpCode {
|
||||
};
|
||||
|
||||
enum SaveType {
|
||||
SAVE_KEEP = 0, /* SAVE S */
|
||||
SAVE_S = 1,
|
||||
SAVE_KEEP = 0, /* SAVE S */
|
||||
SAVE_S = 1,
|
||||
SAVE_RIGHT_RANGE = 2,
|
||||
};
|
||||
|
||||
@@ -642,116 +605,57 @@ typedef int ModeType;
|
||||
#define SIZE_UPDATE_VAR_TYPE sizeof(UpdateVarType)
|
||||
#define SIZE_MODE sizeof(ModeType)
|
||||
|
||||
#define GET_RELADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, RelAddrType)
|
||||
#define GET_ABSADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, AbsAddrType)
|
||||
#define GET_LENGTH_INC(len,p) PLATFORM_GET_INC(len, p, LengthType)
|
||||
#define GET_MEMNUM_INC(num,p) PLATFORM_GET_INC(num, p, MemNumType)
|
||||
#define GET_REPEATNUM_INC(num,p) PLATFORM_GET_INC(num, p, RepeatNumType)
|
||||
#define GET_OPTION_INC(option,p) PLATFORM_GET_INC(option, p, OnigOptionType)
|
||||
#define GET_POINTER_INC(ptr,p) PLATFORM_GET_INC(ptr, p, PointerType)
|
||||
#define GET_SAVE_TYPE_INC(type,p) PLATFORM_GET_INC(type, p, SaveType)
|
||||
#define GET_UPDATE_VAR_TYPE_INC(type,p) PLATFORM_GET_INC(type, p, UpdateVarType)
|
||||
#define GET_MODE_INC(mode,p) PLATFORM_GET_INC(mode, p, ModeType)
|
||||
|
||||
/* code point's address must be aligned address. */
|
||||
#define GET_CODE_POINT(code,p) code = *((OnigCodePoint* )(p))
|
||||
#define GET_BYTE_INC(byte,p) do{\
|
||||
byte = *(p);\
|
||||
(p)++;\
|
||||
} while(0)
|
||||
|
||||
|
||||
/* op-code + arg size */
|
||||
#if 0
|
||||
#define SIZE_OP_ANYCHAR_STAR SIZE_OPCODE
|
||||
#define SIZE_OP_ANYCHAR_STAR_PEEK_NEXT (SIZE_OPCODE + 1)
|
||||
#define SIZE_OP_JUMP (SIZE_OPCODE + SIZE_RELADDR)
|
||||
#define SIZE_OP_PUSH (SIZE_OPCODE + SIZE_RELADDR)
|
||||
#define SIZE_OP_PUSH_SUPER (SIZE_OPCODE + SIZE_RELADDR)
|
||||
#define SIZE_OP_POP_OUT SIZE_OPCODE
|
||||
#ifdef USE_OP_PUSH_OR_JUMP_EXACT
|
||||
#define SIZE_OP_PUSH_OR_JUMP_EXACT1 (SIZE_OPCODE + SIZE_RELADDR + 1)
|
||||
#endif
|
||||
#define SIZE_OP_PUSH_IF_PEEK_NEXT (SIZE_OPCODE + SIZE_RELADDR + 1)
|
||||
#define SIZE_OP_REPEAT_INC (SIZE_OPCODE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_REPEAT_INC_NG (SIZE_OPCODE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_WORD_BOUNDARY (SIZE_OPCODE + SIZE_MODE)
|
||||
#define SIZE_OP_PREC_READ_START SIZE_OPCODE
|
||||
#define SIZE_OP_PREC_READ_NOT_START (SIZE_OPCODE + SIZE_RELADDR)
|
||||
#define SIZE_OP_PREC_READ_END SIZE_OPCODE
|
||||
#define SIZE_OP_PREC_READ_NOT_END SIZE_OPCODE
|
||||
#define SIZE_OP_FAIL SIZE_OPCODE
|
||||
#define SIZE_OP_MEMORY_START (SIZE_OPCODE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_MEMORY_START_PUSH (SIZE_OPCODE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_MEMORY_END_PUSH (SIZE_OPCODE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_MEMORY_END_PUSH_REC (SIZE_OPCODE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_MEMORY_END (SIZE_OPCODE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_MEMORY_END_REC (SIZE_OPCODE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_ATOMIC_START SIZE_OPCODE
|
||||
#define SIZE_OP_ATOMIC_END SIZE_OPCODE
|
||||
#define SIZE_OP_EMPTY_CHECK_START (SIZE_OPCODE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_EMPTY_CHECK_END (SIZE_OPCODE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_LOOK_BEHIND (SIZE_OPCODE + SIZE_LENGTH)
|
||||
#define SIZE_OP_LOOK_BEHIND_NOT_START (SIZE_OPCODE + SIZE_RELADDR + SIZE_LENGTH)
|
||||
#define SIZE_OP_LOOK_BEHIND_NOT_END SIZE_OPCODE
|
||||
#define SIZE_OP_CALL (SIZE_OPCODE + SIZE_ABSADDR)
|
||||
#define SIZE_OP_RETURN SIZE_OPCODE
|
||||
#define SIZE_OP_PUSH_SAVE_VAL (SIZE_OPCODE + SIZE_SAVE_TYPE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_UPDATE_VAR (SIZE_OPCODE + SIZE_UPDATE_VAR_TYPE + SIZE_MEMNUM)
|
||||
|
||||
#ifdef USE_CALLOUT
|
||||
#define SIZE_OP_CALLOUT_CONTENTS (SIZE_OPCODE + SIZE_MEMNUM)
|
||||
#define SIZE_OP_CALLOUT_NAME (SIZE_OPCODE + SIZE_MEMNUM + SIZE_MEMNUM)
|
||||
#endif
|
||||
|
||||
#else /* if 0 */
|
||||
|
||||
/* for relative address increment to go next op. */
|
||||
#define SIZE_INC_OP 1
|
||||
#define SIZE_INC 1
|
||||
|
||||
#define SIZE_OP_ANYCHAR_STAR 1
|
||||
#define SIZE_OP_ANYCHAR_STAR_PEEK_NEXT 1
|
||||
#define SIZE_OP_JUMP 1
|
||||
#define SIZE_OP_PUSH 1
|
||||
#define SIZE_OP_PUSH_SUPER 1
|
||||
#define SIZE_OP_POP_OUT 1
|
||||
#define OPSIZE_ANYCHAR_STAR 1
|
||||
#define OPSIZE_ANYCHAR_STAR_PEEK_NEXT 1
|
||||
#define OPSIZE_JUMP 1
|
||||
#define OPSIZE_PUSH 1
|
||||
#define OPSIZE_PUSH_SUPER 1
|
||||
#define OPSIZE_POP_OUT 1
|
||||
#ifdef USE_OP_PUSH_OR_JUMP_EXACT
|
||||
#define SIZE_OP_PUSH_OR_JUMP_EXACT1 1
|
||||
#define OPSIZE_PUSH_OR_JUMP_EXACT1 1
|
||||
#endif
|
||||
#define SIZE_OP_PUSH_IF_PEEK_NEXT 1
|
||||
#define SIZE_OP_REPEAT 1
|
||||
#define SIZE_OP_REPEAT_INC 1
|
||||
#define SIZE_OP_REPEAT_INC_NG 1
|
||||
#define SIZE_OP_WORD_BOUNDARY 1
|
||||
#define SIZE_OP_PREC_READ_START 1
|
||||
#define SIZE_OP_PREC_READ_NOT_START 1
|
||||
#define SIZE_OP_PREC_READ_END 1
|
||||
#define SIZE_OP_PREC_READ_NOT_END 1
|
||||
#define SIZE_OP_BACKREF 1
|
||||
#define SIZE_OP_FAIL 1
|
||||
#define SIZE_OP_MEMORY_START 1
|
||||
#define SIZE_OP_MEMORY_START_PUSH 1
|
||||
#define SIZE_OP_MEMORY_END_PUSH 1
|
||||
#define SIZE_OP_MEMORY_END_PUSH_REC 1
|
||||
#define SIZE_OP_MEMORY_END 1
|
||||
#define SIZE_OP_MEMORY_END_REC 1
|
||||
#define SIZE_OP_ATOMIC_START 1
|
||||
#define SIZE_OP_ATOMIC_END 1
|
||||
#define SIZE_OP_EMPTY_CHECK_START 1
|
||||
#define SIZE_OP_EMPTY_CHECK_END 1
|
||||
#define SIZE_OP_LOOK_BEHIND 1
|
||||
#define SIZE_OP_LOOK_BEHIND_NOT_START 1
|
||||
#define SIZE_OP_LOOK_BEHIND_NOT_END 1
|
||||
#define SIZE_OP_CALL 1
|
||||
#define SIZE_OP_RETURN 1
|
||||
#define SIZE_OP_PUSH_SAVE_VAL 1
|
||||
#define SIZE_OP_UPDATE_VAR 1
|
||||
#define OPSIZE_PUSH_IF_PEEK_NEXT 1
|
||||
#define OPSIZE_REPEAT 1
|
||||
#define OPSIZE_REPEAT_INC 1
|
||||
#define OPSIZE_REPEAT_INC_NG 1
|
||||
#define OPSIZE_WORD_BOUNDARY 1
|
||||
#define OPSIZE_PREC_READ_START 1
|
||||
#define OPSIZE_PREC_READ_NOT_START 1
|
||||
#define OPSIZE_PREC_READ_END 1
|
||||
#define OPSIZE_PREC_READ_NOT_END 1
|
||||
#define OPSIZE_BACKREF 1
|
||||
#define OPSIZE_FAIL 1
|
||||
#define OPSIZE_MEM_START 1
|
||||
#define OPSIZE_MEM_START_PUSH 1
|
||||
#define OPSIZE_MEM_END_PUSH 1
|
||||
#define OPSIZE_MEM_END_PUSH_REC 1
|
||||
#define OPSIZE_MEM_END 1
|
||||
#define OPSIZE_MEM_END_REC 1
|
||||
#define OPSIZE_ATOMIC_START 1
|
||||
#define OPSIZE_ATOMIC_END 1
|
||||
#define OPSIZE_EMPTY_CHECK_START 1
|
||||
#define OPSIZE_EMPTY_CHECK_END 1
|
||||
#define OPSIZE_LOOK_BEHIND 1
|
||||
#define OPSIZE_LOOK_BEHIND_NOT_START 1
|
||||
#define OPSIZE_LOOK_BEHIND_NOT_END 1
|
||||
#define OPSIZE_CALL 1
|
||||
#define OPSIZE_RETURN 1
|
||||
#define OPSIZE_PUSH_SAVE_VAL 1
|
||||
#define OPSIZE_UPDATE_VAR 1
|
||||
|
||||
#ifdef USE_CALLOUT
|
||||
#define SIZE_OP_CALLOUT_CONTENTS 1
|
||||
#define SIZE_OP_CALLOUT_NAME 1
|
||||
#define OPSIZE_CALLOUT_CONTENTS 1
|
||||
#define OPSIZE_CALLOUT_NAME 1
|
||||
#endif
|
||||
#endif /* if 0 */
|
||||
|
||||
|
||||
#define MC_ESC(syn) (syn)->meta_char_table.esc
|
||||
@@ -882,7 +786,7 @@ typedef struct {
|
||||
} repeat; /* REPEAT, REPEAT_NG */
|
||||
struct {
|
||||
MemNumType id;
|
||||
} repeat_inc; /* REPEAT_INC, REPEAT_INC_SG, REPEAT_INC_NG, REPEAT_INC_NG_SG */
|
||||
} repeat_inc; /* REPEAT_INC, REPEAT_INC_NG */
|
||||
struct {
|
||||
MemNumType mem;
|
||||
} empty_check_start;
|
||||
@@ -933,48 +837,58 @@ typedef struct {
|
||||
#endif
|
||||
} RegexExt;
|
||||
|
||||
typedef struct {
|
||||
int lower;
|
||||
int upper;
|
||||
union {
|
||||
Operation* pcode; /* address of repeated body */
|
||||
int offset;
|
||||
} u;
|
||||
} RepeatRange;
|
||||
|
||||
struct re_pattern_buffer {
|
||||
/* common members of BBuf(bytes-buffer) */
|
||||
Operation* ops;
|
||||
#ifdef USE_DIRECT_THREADED_CODE
|
||||
enum OpCode* ocs;
|
||||
#endif
|
||||
Operation* ops_curr;
|
||||
unsigned int ops_used; /* used space for ops */
|
||||
unsigned int ops_alloc; /* allocated space for ops */
|
||||
Operation* ops_curr;
|
||||
unsigned int ops_used; /* used space for ops */
|
||||
unsigned int ops_alloc; /* allocated space for ops */
|
||||
unsigned char* string_pool;
|
||||
unsigned char* string_pool_end;
|
||||
|
||||
int num_mem; /* used memory(...) num counted from 1 */
|
||||
int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */
|
||||
int num_null_check; /* OP_EMPTY_CHECK_START/END id counter */
|
||||
int num_call; /* number of subexp call */
|
||||
unsigned int capture_history; /* (?@...) flag (1-31) */
|
||||
unsigned int bt_mem_start; /* need backtrack flag */
|
||||
unsigned int bt_mem_end; /* need backtrack flag */
|
||||
int stack_pop_level;
|
||||
int repeat_range_alloc;
|
||||
OnigRepeatRange* repeat_range;
|
||||
int num_mem; /* used memory(...) num counted from 1 */
|
||||
int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */
|
||||
int num_empty_check; /* OP_EMPTY_CHECK_START/END id counter */
|
||||
int num_call; /* number of subexp call */
|
||||
MemStatusType capture_history; /* (?@...) flag (1-31) */
|
||||
MemStatusType push_mem_start; /* need backtrack flag */
|
||||
MemStatusType push_mem_end; /* need backtrack flag */
|
||||
MemStatusType empty_status_mem;
|
||||
int stack_pop_level;
|
||||
int repeat_range_alloc;
|
||||
RepeatRange* repeat_range;
|
||||
|
||||
OnigEncoding enc;
|
||||
OnigOptionType options;
|
||||
OnigSyntaxType* syntax;
|
||||
OnigCaseFoldType case_fold_flag;
|
||||
void* name_table;
|
||||
OnigEncoding enc;
|
||||
OnigOptionType options;
|
||||
OnigSyntaxType* syntax;
|
||||
OnigCaseFoldType case_fold_flag;
|
||||
void* name_table;
|
||||
|
||||
/* optimization info (string search, char-map and anchors) */
|
||||
int optimize; /* optimize flag */
|
||||
int threshold_len; /* search str-length for apply optimize */
|
||||
int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */
|
||||
OnigLen anchor_dmin; /* (SEMI_)END_BUF anchor distance */
|
||||
OnigLen anchor_dmax; /* (SEMI_)END_BUF anchor distance */
|
||||
OnigLen anc_dist_min; /* (SEMI_)END_BUF anchor distance */
|
||||
OnigLen anc_dist_max; /* (SEMI_)END_BUF anchor distance */
|
||||
int sub_anchor; /* start-anchor for exact or map */
|
||||
unsigned char *exact;
|
||||
unsigned char *exact_end;
|
||||
unsigned char map[CHAR_MAP_SIZE]; /* used as BMH skip or char-map */
|
||||
int map_offset;
|
||||
OnigLen dmin; /* min-distance of exact or map */
|
||||
OnigLen dmax; /* max-distance of exact or map */
|
||||
OnigLen dist_min; /* min-distance of exact or map */
|
||||
OnigLen dist_max; /* max-distance of exact or map */
|
||||
RegexExt* extp;
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Loaded 100 of 165 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user