diff --git a/zend/parametersimpl.h b/zend/parametersimpl.h index fa58d9fa..bf100c09 100644 --- a/zend/parametersimpl.h +++ b/zend/parametersimpl.h @@ -29,7 +29,7 @@ class ParametersImpl : public Parameters reserve(argc); // array to store all the arguments in - zval arguments[argc]; + zval* arguments = static_cast(alloca(argc * sizeof(zval))); // retrieve the arguments zend_get_parameters_array_ex(argc, arguments); diff --git a/zend/value.cpp b/zend/value.cpp index a50d4991..2043fb2b 100644 --- a/zend/value.cpp +++ b/zend/value.cpp @@ -884,7 +884,7 @@ Value Value::call(const char *name) Value Value::exec(int argc, Value *argv) const { // array of zvals to execute - zval params[argc]; + zval* params = static_cast(alloca(argc * sizeof(zval))); // convert all the values for(int i = 0; i < argc; i++) { params[i] = *argv[i]._val; } @@ -906,7 +906,7 @@ Value Value::exec(const char *name, int argc, Value *argv) const Value method(name); // array of zvals to execute - zval params[argc]; + zval* params = static_cast(alloca(argc * sizeof(zval))); // convert all the values for(int i = 0; i < argc; i++) { params[i] = *argv[i]._val; } @@ -928,7 +928,7 @@ Value Value::exec(const char *name, int argc, Value *argv) Value method(name); // array of zvals to execute - zval params[argc]; + zval* params = static_cast(alloca(argc * sizeof(zval))); // convert all the values for(int i = 0; i < argc; i++) { params[i] = *argv[i]._val; }