Selaa lähdekoodia

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

woollybah 11 vuotta sitten
vanhempi
commit
5f4c4955d6
1 muutettua tiedostoa jossa 7 lisäystä ja 0 poistoa
  1. 7 0
      decl.bmx

+ 7 - 0
decl.bmx

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