From 448f13b55da0e9ccabb425741e6aa04d3b3b36c1 Mon Sep 17 00:00:00 2001 From: johnche Date: Wed, 3 Nov 2021 18:13:10 +0800 Subject: [PATCH] =?UTF-8?q?[unreal]=E8=93=9D=E5=9B=BE=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E6=94=B9=E4=B8=BA=E5=92=8C?= =?UTF-8?q?=E5=BC=95=E6=93=8EScriptCore.cpp=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/JsEnv/Private/FunctionTranslator.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/unreal/Puerts/Source/JsEnv/Private/FunctionTranslator.cpp b/unreal/Puerts/Source/JsEnv/Private/FunctionTranslator.cpp index 97225073a1..bfbb13bdf6 100644 --- a/unreal/Puerts/Source/JsEnv/Private/FunctionTranslator.cpp +++ b/unreal/Puerts/Source/JsEnv/Private/FunctionTranslator.cpp @@ -367,17 +367,19 @@ void FFunctionTranslator::CallJs(v8::Isolate* Isolate, v8::Local& C FOutParmRec** LastOut = nullptr; if (!Stack.OutParms) LastOut = &Stack.OutParms; //ScriptCore.cpp - for (TFieldIterator It(Function.Get()); It && Stack.PeekCode() != EX_EndFunctionParms; ++It) + for (FProperty* Property = (FProperty*)(Function->ChildProperties); *Stack.Code != EX_EndFunctionParms; Property = (FProperty*)(Property->Next)) { - It->InitializeValue_InContainer(Params); + checkfSlow(Property, TEXT("NULL Property in Function %s"), *Function->GetPathName()); - if( ((It->PropertyFlags & CPF_ReturnParm) != 0) || ((It->PropertyFlags & CPF_Parm) != CPF_Parm) ) + Property->InitializeValue_InContainer(Params); + + if ((Property->PropertyFlags & CPF_ReturnParm) != 0) { continue; } Stack.MostRecentPropertyAddress = nullptr; - if ( It->PropertyFlags & CPF_OutParm) + if ( Property->PropertyFlags & CPF_OutParm) { Stack.Step(Stack.Object, NULL); @@ -386,8 +388,8 @@ void FFunctionTranslator::CallJs(v8::Isolate* Isolate, v8::Local& C CA_SUPPRESS(6263) FOutParmRec* Out = (FOutParmRec*)FMemory_Alloca(sizeof(FOutParmRec)); ensure(Stack.MostRecentPropertyAddress); - Out->PropAddr = (Stack.MostRecentPropertyAddress != NULL) ? Stack.MostRecentPropertyAddress : It->ContainerPtrToValuePtr(Params); - Out->Property = *It; + Out->PropAddr = (Stack.MostRecentPropertyAddress != NULL) ? Stack.MostRecentPropertyAddress : Property->ContainerPtrToValuePtr(Params); + Out->Property = Property; if (*LastOut) { @@ -402,7 +404,7 @@ void FFunctionTranslator::CallJs(v8::Isolate* Isolate, v8::Local& C } else { - Stack.Step(Stack.Object, It->ContainerPtrToValuePtr(Params)); + Stack.Step(Stack.Object, Property->ContainerPtrToValuePtr(Params)); } } }