From aabd84368d23581d5283b91639a53627dfdbf80b Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 18 Apr 2023 09:08:15 -0700 Subject: [PATCH] Fixed ce dependency issue with mCeInnerFunctionInfo --- IDEHelper/Compiler/CeMachine.cpp | 11 ++++++++++- IDEHelper/Compiler/CeMachine.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/CeMachine.cpp b/IDEHelper/Compiler/CeMachine.cpp index c0412ef5..796eaf8a 100644 --- a/IDEHelper/Compiler/CeMachine.cpp +++ b/IDEHelper/Compiler/CeMachine.cpp @@ -508,6 +508,15 @@ CeFunction::~CeFunction() BfLogSys(mCeMachine->mCompiler->mSystem, "CeFunction::~CeFunction %p\n", this); } +BfTypeInstance* CeFunction::GetOwner() +{ + if (mCeFunctionInfo != NULL) + return mCeFunctionInfo->GetOwner(); + if (mCeInnerFunctionInfo != NULL) + return mCeInnerFunctionInfo->mOwner->GetOwner(); + return NULL; +} + void CeFunction::Print() { CeDumpContext dumpCtx; @@ -1422,7 +1431,7 @@ int CeBuilder::GetCallTableIdx(BeFunction* beFunction, CeOperand* outOperand) if ((ceFunctionInfo != NULL) && (mCeFunction->mCeFunctionInfo != NULL)) { - auto callerType = mCeFunction->mCeFunctionInfo->GetOwner(); + auto callerType = mCeFunction->GetOwner(); auto calleeType = ceFunctionInfo->GetOwner(); if ((callerType != NULL) && (calleeType != NULL)) diff --git a/IDEHelper/Compiler/CeMachine.h b/IDEHelper/Compiler/CeMachine.h index 4c101b49..548412e3 100644 --- a/IDEHelper/Compiler/CeMachine.h +++ b/IDEHelper/Compiler/CeMachine.h @@ -685,6 +685,7 @@ public: } ~CeFunction(); + BfTypeInstance* GetOwner(); void Print(); void UnbindBreakpoints(); CeEmitEntry* FindEmitEntry(int loc, int* entryIdx = NULL);