Skip to content

Commit 1630d96

Browse files
author
Roland Eischer
committed
Fixed VLA definition because not every compiler supports that
1 parent a5ca2f3 commit 1630d96

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

zend/parametersimpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ParametersImpl : public Parameters
2929
reserve(argc);
3030

3131
// array to store all the arguments in
32-
zval arguments[argc];
32+
zval* arguments = static_cast<zval*>(alloca(argc * sizeof(zval)));
3333

3434
// retrieve the arguments
3535
zend_get_parameters_array_ex(argc, arguments);

zend/value.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ Value Value::call(const char *name)
884884
Value Value::exec(int argc, Value *argv) const
885885
{
886886
// array of zvals to execute
887-
zval params[argc];
887+
zval* params = static_cast<zval*>(alloca(argc * sizeof(zval)));
888888

889889
// convert all the values
890890
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
906906
Value method(name);
907907

908908
// array of zvals to execute
909-
zval params[argc];
909+
zval* params = static_cast<zval*>(alloca(argc * sizeof(zval)));
910910

911911
// convert all the values
912912
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)
928928
Value method(name);
929929

930930
// array of zvals to execute
931-
zval params[argc];
931+
zval* params = static_cast<zval*>(alloca(argc * sizeof(zval)));
932932

933933
// convert all the values
934934
for(int i = 0; i < argc; i++) { params[i] = *argv[i]._val; }

0 commit comments

Comments
 (0)