diff --git a/ecmascript/compiler/builtins/builtins_function_stub_builder.cpp b/ecmascript/compiler/builtins/builtins_function_stub_builder.cpp index e3d782e2f182bb2d3d8a3efcd7bd0192119e6bae..c9c1706a50a29804c9963ae480facbe760fd8f06 100644 --- a/ecmascript/compiler/builtins/builtins_function_stub_builder.cpp +++ b/ecmascript/compiler/builtins/builtins_function_stub_builder.cpp @@ -185,7 +185,10 @@ GateRef BuiltinsFunctionStubBuilder::BuildArgumentsListFastElements(GateRef glue Branch(IsStableJSArray(glue, arrayObj), &targetIsStableJSArray, &targetNotStableJSArray); Bind(&targetIsStableJSArray); { - res = GetElementsArray(arrayObj); + arrayObj = GetElementsArray(arrayObj); + DEFVARIABLE(length, VariableType::INT32(), GetLengthOfTaggedArray(arrayObj)); + res = CallRuntime(glue, RTSTUB_ID(CopyArray), + { arrayObj, IntToTaggedInt(*length), IntToTaggedInt(*length) }); Label isMutantTaggedArray(env); Branch(IsMutantTaggedArray(*res), &isMutantTaggedArray, &exit); Bind(&isMutantTaggedArray);