Преглед изворни кода

prevent segfault with derefencing pointers to pointers that point to null

dave camp пре 9 година
родитељ
комит
60c711dbda
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      appstub.mod/debugger_mt.stdio.bmx

+ 5 - 0
appstub.mod/debugger_mt.stdio.bmx

@@ -429,6 +429,11 @@ Function DebugDerefPointer$(decl:Int Ptr, pointer:Int Ptr)
 ?
 ?
 	Next
 	Next
 
 
+	' make sure the final pointer is not null
+	If pointer = 0 
+		Return " {-}"
+	EndIf
+
 	Local value:String
 	Local value:String
 	Select datatype
 	Select datatype
 	Case "Byte"
 	Case "Byte"