3 Commits

Author SHA1 Message Date
Xinchen Hui
84c831e4cb releasing 2.0.6 2018-12-21 11:11:37 +08:00
Xinchen Hui
f588c88528 Fixed hash recursive detecting 2018-12-21 11:09:57 +08:00
Xinchen Hui
ad31d5f7c6 back to dev 2017-12-31 12:34:09 +08:00
4 changed files with 53 additions and 15 deletions

View File

@@ -1,4 +1,3 @@
dnl $Id: config.m4 321796 2012-01-05 17:23:48Z laruence $
PHP_ARG_WITH(lua, for lua support,
[ --with-lua=[DIR] Include php lua support])
PHP_ARG_WITH(lua-version, to specify a custom lua version, [ --with-lua-version=[VERSION]] Use the specified lua version.)

36
lua.c
View File

@@ -430,13 +430,29 @@ try_again:
zval zkey;
HashTable *ht = HASH_OF(val);
if (ZEND_HASH_APPLY_PROTECTION(ht)) {
ZEND_HASH_INC_APPLY_COUNT(ht);
if (ZEND_HASH_GET_APPLY_COUNT(ht) > 1) {
if (
#if PHP_VERSION_ID < 70300
ZEND_HASH_APPLY_PROTECTION(ht)
#else
!(GC_FLAGS(ht) & GC_IMMUTABLE)
#endif
) {
if (
#if PHP_VERSION_ID < 70300
ZEND_HASH_GET_APPLY_COUNT(ht)
#else
GC_IS_RECURSIVE(ht)
#endif
) {
php_error_docref(NULL, E_ERROR, "recursion found");
ZEND_HASH_DEC_APPLY_COUNT(ht);
break;
}
#if PHP_VERSION_ID < 70300
ZEND_HASH_INC_APPLY_COUNT(ht);
#else
GC_PROTECT_RECURSION(ht);
#endif
}
lua_newtable(L);
@@ -452,8 +468,18 @@ try_again:
lua_settable(L, -3);
} ZEND_HASH_FOREACH_END();
if (ZEND_HASH_APPLY_PROTECTION(ht)) {
if (
#if PHP_VERSION_ID < 70300
ZEND_HASH_APPLY_PROTECTION(ht)
#else
!(GC_FLAGS(ht) & GC_IMMUTABLE)
#endif
) {
#if PHP_VERSION_ID < 70300
ZEND_HASH_DEC_APPLY_COUNT(ht);
#else
GC_UNPROTECT_RECURSION(ht);
#endif
}
}
}

View File

@@ -23,11 +23,11 @@
<email>msaraujo@php.net</email>
<active>yes</active>
</developer>
<date>2017-12-31</date>
<time>19:15:00</time>
<date>2018-12-21</date>
<time>11:10:00</time>
<version>
<release>2.0.5</release>
<api>2.0.5</api>
<release>2.0.6</release>
<api>2.0.6</api>
</version>
<stability>
<release>stable</release>
@@ -35,9 +35,7 @@
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
- Refactor LuaClosure. (SaraG)
- Fix non-string member access in read/write prop. (SaraG)
- Fix allocation of lua object. (SaraG)
- Fixed Hash Recursive Detecting in PHP-7.3
</notes>
<contents>
<dir name="/">
@@ -84,6 +82,22 @@
<providesextension>lua</providesextension>
<extsrcrelease />
<changelog>
<release>
<date>2018-12-21</date>
<version>
<release>2.0.6</release>
<api>2.0.6</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Fixed Hash Recursive Detecting in PHP-7.3
</notes>
</release>
<release>
<date>2017-12-31</date>
<version>
@@ -101,7 +115,6 @@
- Fix allocation of lua object. (SaraG)
</notes>
</release>
<release>
<date>2017-07-12</date>
<version>

View File

@@ -48,7 +48,7 @@ extern zend_module_entry lua_module_entry;
#define LUA_G(v) (lua_globals.v)
#endif
#define PHP_LUA_VERSION "2.0.5"
#define PHP_LUA_VERSION "2.0.6"
struct _php_lua_object {
lua_State *L;