소스 검색

Fixed globalvar-derived const addr assigned to local variable

Brian Fiete 7 달 전
부모
커밋
ab93fb83a4
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      IDEHelper/Compiler/BfStmtEvaluator.cpp

+ 5 - 1
IDEHelper/Compiler/BfStmtEvaluator.cpp

@@ -1659,7 +1659,11 @@ BfLocalVariable* BfModule::HandleVariableDeclaration(BfVariableDeclaration* varD
 
 
 	auto _CheckConst = [&]
 	auto _CheckConst = [&]
 	{
 	{
-		if (initValue.mValue.IsConst())
+		if (initValue.IsAddr())
+		{
+			isConst = false;
+		}
+		else if (initValue.mValue.IsConst())
 		{
 		{
 			auto constant = mBfIRBuilder->GetConstant(initValue.mValue);
 			auto constant = mBfIRBuilder->GetConstant(initValue.mValue);