diff options
Diffstat (limited to 'src/qml/jsruntime/qv4regexpobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4regexpobject.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp index bab4a32073..899938faae 100644 --- a/src/qml/jsruntime/qv4regexpobject.cpp +++ b/src/qml/jsruntime/qv4regexpobject.cpp @@ -374,8 +374,9 @@ ReturnedValue RegExpPrototype::method_compile(SimpleCallContext *ctx) ctx->throwTypeError(); ScopedCallData callData(scope, ctx->callData->argc); - memcpy(callData->args, ctx->callData->args, ctx->callData->argc*sizeof(Value)); - RegExpObject *re = Value::fromReturnedValue(ctx->engine->regExpCtor.asFunctionObject()->construct(callData)).as<RegExpObject>(); + memcpy(callData->args, ctx->callData->args, ctx->callData->argc*sizeof(SafeValue)); + + Scoped<RegExpObject> re(scope, ctx->engine->regExpCtor.asFunctionObject()->construct(callData)); r->value = re->value; r->global = re->global; |