]> granicus.if.org Git - php/commitdiff
Fixed compilation on Windows
authorDmitry Stogov <dmitry@php.net>
Fri, 23 Nov 2007 15:03:03 +0000 (15:03 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 23 Nov 2007 15:03:03 +0000 (15:03 +0000)
Zend/zend.h
Zend/zend_vm_execute.h
Zend/zend_vm_execute.skl

index 870015caa5ee723453b12544f6efc23519f92f4f..b883dd9c3334465d422a7b13f28e8a739cfd593d 100644 (file)
@@ -180,6 +180,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) \
@@ -188,6 +190,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
index e6c7fb1d1fbb7528e5fa8d7f4ee85d6d0606d1fe..dda04218f14a3c936153a582afc00e93ec762f93 100644 (file)
@@ -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);
index 95d13606e4cee737139f43c7b92d43d488b310ec..99542a54532727ab13af2577714f87f4153c025b 100644 (file)
@@ -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);