diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-11-04 10:54:08 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-11-04 10:54:08 +0100 |
commit | e0d6c3f7bae2644802f13bd1ae1f49c3d08a8e07 (patch) | |
tree | 72b7642f3f6e870ba2361961c779d8c8bea25580 /Zend | |
parent | 4e68c53a210648aa03415f1683ba83d45b67c17c (diff) | |
download | php-git-e0d6c3f7bae2644802f13bd1ae1f49c3d08a8e07.tar.gz |
Fix dynamic function definition in preload script
We should use normal function renaming if the function is declared
during preloading itself, rather than afterwards.
This fixes a regression introduced by
68f80be9d1380de731930187250a7ed6b55ae196.
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_compile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 810e384177..df4cd4b2f3 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1050,7 +1050,8 @@ ZEND_API int do_bind_function(zval *lcname) /* {{{ */ return FAILURE; } function = (zend_function*)Z_PTR_P(zv); - if (UNEXPECTED(function->common.fn_flags & ZEND_ACC_PRELOADED)) { + if (UNEXPECTED(function->common.fn_flags & ZEND_ACC_PRELOADED) + && !(CG(compiler_options) & ZEND_COMPILE_PRELOAD)) { zv = zend_hash_add(EG(function_table), Z_STR_P(lcname), zv); } else { zv = zend_hash_set_bucket_key(EG(function_table), (Bucket*)zv, Z_STR_P(lcname)); |