diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 7a996329..c0da5194 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -3113,6 +3113,12 @@ BfError* BfModule::Fail(const StringImpl& error, BfAstNode* refNode, bool isPers } } + if ((mCurMethodState != NULL) && (mCurMethodState->mConstResolveState != NULL) && (mCurMethodState->mConstResolveState->mInCalcAppend)) + { + mCurMethodState->mConstResolveState->mFailed = true; + return NULL; + } + if (mCurMethodInstance != NULL) mCurMethodInstance->mHasFailed = true; @@ -16617,6 +16623,8 @@ BfTypedValue BfModule::TryConstCalcAppend(BfMethodInstance* methodInst, SizedArr appendAllocVisitor.mModule = this; appendAllocVisitor.VisitChild(methodDecl->mBody); + if (constResolveState.mFailed) + appendAllocVisitor.mFailed = true; if (!appendAllocVisitor.mFailed) constValue = appendAllocVisitor.mConstAccum; if (isFirstRun) diff --git a/IDEHelper/Compiler/BfModule.h b/IDEHelper/Compiler/BfModule.h index 47ab5df1..f18221aa 100644 --- a/IDEHelper/Compiler/BfModule.h +++ b/IDEHelper/Compiler/BfModule.h @@ -921,12 +921,14 @@ public: BfMethodInstance* mMethodInstance; BfConstResolveState* mPrevConstResolveState; bool mInCalcAppend; + bool mFailed; BfConstResolveState() { mMethodInstance = NULL; mPrevConstResolveState = NULL; mInCalcAppend = false; + mFailed = false; } };