Skip to content

Commit

Permalink
Merge pull request #326 from atvise/fixed_variable_length_arrays
Browse files Browse the repository at this point in the history
Fixed VLA definition because not every compiler supports that
  • Loading branch information
EmielBruijntjes authored Nov 24, 2023
2 parents d2dc9b7 + 1630d96 commit d778788
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion zend/parametersimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ParametersImpl : public Parameters
reserve(argc);

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

// retrieve the arguments
zend_get_parameters_array_ex(argc, arguments);
Expand Down
6 changes: 3 additions & 3 deletions zend/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,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<zval*>(alloca(argc * sizeof(zval)));

// convert all the values
for(int i = 0; i < argc; i++) { params[i] = *argv[i]._val; }
Expand All @@ -925,7 +925,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<zval*>(alloca(argc * sizeof(zval)));

// convert all the values
for(int i = 0; i < argc; i++) { params[i] = *argv[i]._val; }
Expand All @@ -947,7 +947,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<zval*>(alloca(argc * sizeof(zval)));

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

0 comments on commit d778788

Please sign in to comment.