Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed VLA definition because not every compiler supports that #326

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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<zval*>(alloca(argc * sizeof(zval)));

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

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

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