Răsfoiți Sursa

Fixed a missing abort() on null checks, under certain situations.

woollybah 11 ani în urmă
părinte
comite
179a8f013b
1 a modificat fișierele cu 5 adăugiri și 2 ștergeri
  1. 5 2
      translator.bmx

+ 5 - 2
translator.bmx

@@ -929,9 +929,9 @@ End Rem
 		If TObjectType(ty) Or TStringType(ty) Or TArrayType(ty) Then
 		If TObjectType(ty) Or TStringType(ty) Or TArrayType(ty) Then
 			' null test
 			' null test
 			If trans Then
 			If trans Then
-				debugOut :+ indent + "if (!" + id + ") {~n"
+				debugOut :+ indent + "if (" + id + "==NULL) {~n"
 			Else
 			Else
-				Emit "if (!" + id + ") {"
+				Emit "if (" + id + "==NULL) {"
 			End If
 			End If
 			DebugPrint("Null Pointer : " + id, func, trans)
 			DebugPrint("Null Pointer : " + id, func, trans)
 			If trans Then
 			If trans Then
@@ -940,6 +940,9 @@ End Rem
 				End If
 				End If
 				debugOut :+ indent + "}~n"
 				debugOut :+ indent + "}~n"
 			Else
 			Else
+				If ABORT_ON_NULL Then
+					Emit "abort();~n"
+				End If
 				Emit "}"
 				Emit "}"
 			End If
 			End If
 		End If
 		End If