From: Dmitry Stogov Date: Fri, 23 Nov 2007 15:02:50 +0000 (+0000) Subject: Fixed compilation on Windows X-Git-Tag: RELEASE_2_0_0a1~1296 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17c6007445fddb86271ac1d77ee0ad96eb10489f;p=php Fixed compilation on Windows --- diff --git a/Zend/zend.h b/Zend/zend.h index 63c49b32c8..a18dbec934 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -181,6 +181,8 @@ char *alloca (); # define ZEND_ALLOCA_MAX_SIZE (32 * 1024) # define ALLOCA_FLAG(name) \ zend_bool name; +# define SET_ALLOCA_FLAG(name) \ + name = 1 # define do_alloca_ex(size, limit, use_heap) \ ((use_heap = (UNEXPECTED((size) > (limit)))) ? emalloc(size) : alloca(size)) # define do_alloca(size, use_heap) \ @@ -189,6 +191,7 @@ char *alloca (); do { if (UNEXPECTED(use_heap)) efree(p); } while (0) #else # define ALLOCA_FLAG(name) +# define SET_ALLOCA_FLAG(name) # define do_alloca(p, use_heap) emalloc(p) # define free_alloca(p, use_heap) efree(p) #endif diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 99a2bf4a37..b356357e10 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -48,7 +48,7 @@ ZEND_API void execute(zend_op_array *op_array TSRMLS_DC) 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(use_heap) = 1; + SET_ALLOCA_FLAG(EX(use_heap)); EX(CVs) = (zval***)safe_emalloc(sizeof(temp_variable), op_array->T, sizeof(zval**) * op_array->last_var); } EX(Ts) = (temp_variable *)(EX(CVs) + op_array->last_var); diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl index b4366b80ee..05ca0ca225 100644 --- a/Zend/zend_vm_execute.skl +++ b/Zend/zend_vm_execute.skl @@ -19,7 +19,7 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) 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(use_heap) = 1; + SET_ALLOCA_FLAG(EX(use_heap)); EX(CVs) = (zval***)safe_emalloc(sizeof(temp_variable), op_array->T, sizeof(zval**) * op_array->last_var); } EX(Ts) = (temp_variable *)(EX(CVs) + op_array->last_var);