diff options
author | Dmitry Stogov <dmitry@php.net> | 2007-11-22 13:27:13 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2007-11-22 13:27:13 +0000 |
commit | 648fbe9d5838073154f3737829d5298502184343 (patch) | |
tree | bd21fcbb0af89d62032a842dc4e6f29518fa3cdf /Zend/zend_vm_execute.skl | |
parent | 1836daf7f9f3ab088a65fd8c0b8c9421d6550be5 (diff) | |
download | php-git-648fbe9d5838073154f3737829d5298502184343.tar.gz |
Fixed bug #43128 (Very long class name causes segfault)
Diffstat (limited to 'Zend/zend_vm_execute.skl')
-rw-r--r-- | Zend/zend_vm_execute.skl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl index 1f6116b08a..95d13606e4 100644 --- a/Zend/zend_vm_execute.skl +++ b/Zend/zend_vm_execute.skl @@ -16,12 +16,13 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) EX(called_scope) = NULL; EX(object) = NULL; EX(old_error_reporting) = NULL; - if (op_array->T < TEMP_VAR_STACK_LIMIT) { - EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable) * op_array->T); + if (EXPECTED(op_array->T < TEMP_VAR_STACK_LIMIT && op_array->last_var < TEMP_VAR_STACK_LIMIT)) { + EX(CVs) = (zval***)do_alloca(sizeof(zval**) * op_array->last_var + sizeof(temp_variable) * op_array->T, EX(use_heap)); } else { - EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable), op_array->T, 0); + EX(use_heap) = 1; + EX(CVs) = (zval***)safe_emalloc(sizeof(temp_variable), op_array->T, sizeof(zval**) * op_array->last_var); } - EX(CVs) = (zval***)do_alloca(sizeof(zval**) * op_array->last_var); + EX(Ts) = (temp_variable *)(EX(CVs) + op_array->last_var); memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var); EX(op_array) = op_array; EX(original_in_execution) = EG(in_execution); |