summaryrefslogtreecommitdiffstats
path: root/src/v4/qv4functionobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/v4/qv4functionobject.cpp')
-rw-r--r--src/v4/qv4functionobject.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/v4/qv4functionobject.cpp b/src/v4/qv4functionobject.cpp
index 83762e85..801291e0 100644
--- a/src/v4/qv4functionobject.cpp
+++ b/src/v4/qv4functionobject.cpp
@@ -103,6 +103,9 @@ FunctionObject::FunctionObject(ExecutionContext *scope)
needsActivation = true;
usesArgumentsObject = false;
strictMode = false;
+#ifndef QT_NO_DEBUG
+ assert(scope->next != (ExecutionContext *)0x1);
+#endif
}
bool FunctionObject::hasInstance(Managed *that, ExecutionContext *ctx, const Value &value)
@@ -364,7 +367,8 @@ Value ScriptFunction::construct(Managed *that, ExecutionContext *context, Value
if (proto.isObject())
obj->prototype = proto.objectValue();
- ExecutionContext *ctx = context->engine->newCallContext(f, Value::fromObject(obj), args, argc);
+ quintptr stackSpace[stackContextSize/sizeof(quintptr)];
+ ExecutionContext *ctx = context->engine->newCallContext(stackSpace, f, Value::fromObject(obj), args, argc);
Value result = Value::undefinedValue();
try {
@@ -384,7 +388,8 @@ Value ScriptFunction::call(Managed *that, ExecutionContext *context, const Value
{
ScriptFunction *f = static_cast<ScriptFunction *>(that);
assert(f->function->code);
- ExecutionContext *ctx = context->engine->newCallContext(f, thisObject, args, argc);
+ quintptr stackSpace[stackContextSize/sizeof(quintptr)];
+ ExecutionContext *ctx = context->engine->newCallContext(stackSpace, f, thisObject, args, argc);
if (!f->strictMode && !thisObject.isObject()) {
if (thisObject.isUndefined() || thisObject.isNull()) {