Browse Source

Double check that string consts are stored before using them. This tends to happen when consts are used from imported files.

woollybah 11 năm trước cách đây
mục cha
commit
5f4c4955d6
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      decl.bmx

+ 7 - 0
decl.bmx

@@ -324,6 +324,9 @@ Type TConstDecl Extends TValDecl
 		'If Not IsExtern() value=init.Eval()
 		If init Then
 			value=init.Eval()
+			If TStringType(ty) And Not _appInstance.hasStringConst(value) Then
+				_appInstance.mapStringConsts(value)
+			End If
 		End If
 	End Method
 	
@@ -1924,6 +1927,10 @@ pushenv Self
 		Next
 	End Method
 	
+	Method hasStringConst:Int(value:String)
+		Return stringConsts.ValueForKey(value) <> Null
+	End Method
+	
 	Method mapStringConsts(value:String)
 		Local sc:TStringConst = TStringConst(stringConsts.ValueForKey(value))