Skip to content

Commit cbe162f

Browse files
committed
Fixed variable lenght array compilation error
1 parent 43ffda2 commit cbe162f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shellcore/types_jscript.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ bool JScript_function::operator != (const Function_base &UNUSED(other)) const {
133133

134134
Value JScript_function::invoke(const Argument_list &args) {
135135
const unsigned argc = args.size();
136-
v8::Local<v8::Value> argv[argc];
136+
v8::Local<v8::Value> *argv = new v8::Local<v8::Value>[argc];
137137

138138
for(size_t index = 0; index < args.size(); index++)
139139
argv[index] = _js->shcore_value_to_v8_value(args[index]);
@@ -142,5 +142,7 @@ Value JScript_function::invoke(const Argument_list &args) {
142142

143143
v8::Local<v8::Value> ret_val = callback->Call(_js->isolate()->GetCurrentContext()->Global(), argc, argv);
144144

145+
delete[] argv;
146+
145147
return _js->v8_value_to_shcore_value(ret_val);
146148
}

0 commit comments

Comments
 (0)