summaryrefslogtreecommitdiff
path: root/Zend/zend_vm_execute.skl
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_vm_execute.skl')
-rw-r--r--Zend/zend_vm_execute.skl9
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);