Browse Source

prevent segfault with derefencing pointers to pointers that point to null

dave camp 9 years ago
parent
commit
60c711dbda
1 changed files with 5 additions and 0 deletions
  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
 
+	' make sure the final pointer is not null
+	If pointer = 0 
+		Return " {-}"
+	EndIf
+
 	Local value:String
 	Select datatype
 	Case "Byte"