Browse Source

Fixed splat lookup error during closure capture

Brian Fiete 5 years ago
parent
commit
5bdaeadc25
1 changed files with 6 additions and 0 deletions
  1. 6 0
      IDEHelper/Compiler/BfModule.cpp

+ 6 - 0
IDEHelper/Compiler/BfModule.cpp

@@ -10831,6 +10831,12 @@ BfIRValue BfModule::ExtractSplatValue(BfTypedValue typedValue, int componentIdx,
 			if (val)
 				break;
 
+			if ((checkMethodState->mClosureState != NULL) && (checkMethodState->mClosureState->mCapturing))
+			{
+				BF_ASSERT(mBfIRBuilder->mIgnoreWrites);
+				return mBfIRBuilder->GetFakeVal();
+			}
+
 			checkMethodState = checkMethodState->mPrevMethodState;
 		}
 	}