瀏覽代碼

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 = [&]
 	{
-		if (initValue.mValue.IsConst())
+		if (initValue.IsAddr())
+		{
+			isConst = false;
+		}
+		else if (initValue.mValue.IsConst())
 		{
 			auto constant = mBfIRBuilder->GetConstant(initValue.mValue);