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, PHP_ARG_WITH(lua, for lua support,
[ --with-lua=[DIR] Include php 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.) 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; zval zkey;
HashTable *ht = HASH_OF(val); HashTable *ht = HASH_OF(val);
if (ZEND_HASH_APPLY_PROTECTION(ht)) { if (
ZEND_HASH_INC_APPLY_COUNT(ht); #if PHP_VERSION_ID < 70300
if (ZEND_HASH_GET_APPLY_COUNT(ht) > 1) { 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"); php_error_docref(NULL, E_ERROR, "recursion found");
ZEND_HASH_DEC_APPLY_COUNT(ht);
break; break;
} }
#if PHP_VERSION_ID < 70300
ZEND_HASH_INC_APPLY_COUNT(ht);
#else
GC_PROTECT_RECURSION(ht);
#endif
} }
lua_newtable(L); lua_newtable(L);
@@ -452,8 +468,18 @@ try_again:
lua_settable(L, -3); lua_settable(L, -3);
} ZEND_HASH_FOREACH_END(); } 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); ZEND_HASH_DEC_APPLY_COUNT(ht);
#else
GC_UNPROTECT_RECURSION(ht);
#endif
} }
} }
} }

View File

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

View File

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