1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 13:31:27 +02:00

Fixed segfult in JIT (emalloc may trigger memory limitation)

Zend/tests/bug68412.phpt
This commit is contained in:
Xinchen Hui
2017-05-21 20:44:09 +08:00
parent 5d3027d759
commit 26a6d20ab5
2 changed files with 4 additions and 2 deletions

View File

@@ -7783,6 +7783,8 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
zend_execute_data *call;
USE_OPLINE
SAVE_OPLINE();
args = emalloc(sizeof(zend_array));
zend_hash_init(args, num_args, NULL, ZVAL_PTR_DTOR, 0);
if (num_args) {
@@ -7798,7 +7800,6 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
} ZEND_HASH_FILL_END();
}
SAVE_OPLINE();
call = execute_data;
execute_data = EG(current_execute_data) = EX(prev_execute_data);

View File

@@ -1906,6 +1906,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z
zend_execute_data *call;
USE_OPLINE
SAVE_OPLINE();
args = emalloc(sizeof(zend_array));
zend_hash_init(args, num_args, NULL, ZVAL_PTR_DTOR, 0);
if (num_args) {
@@ -1921,7 +1923,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z
} ZEND_HASH_FILL_END();
}
SAVE_OPLINE();
call = execute_data;
execute_data = EG(current_execute_data) = EX(prev_execute_data);