IDE crash when opening procedure callstack (certain conditio

Post bugs related to the IDE here
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

IDE crash when opening procedure callstack (certain conditio

Post by Trond »

When I run the following code with the debugger on it reports an invalid memory access. So I open the procedure callstack to see how it reached that point in the source and then the whole IDE stops reacting.

I don't use any memory pointer operations in the whole thing! How can it give an invalid memory access?

Edit: MUCH shorted trigger code. Instructions: Run, press enter at the prompt.

Note: The code does NOT work, but the invalid memory access error is triggered BEFORE the error in my code! (Which is not an invalid memory access, but an infinite recursion loop.)

Code: Select all

OpenConsole()

Global Look.s
Global Stream.s

;Read a character into Look
Procedure GetChar()
  Look = Left(Stream,1)
  Stream = Right(Stream, Len(Stream)-1)
EndProcedure

;Recognize whitespace
Procedure.b IsWhiteSpace(s.s)
  Select s.s
    Case " "
    Case #TAB$
    Default
      ProcedureReturn 0
  EndSelect
  ProcedureReturn 1
EndProcedure

;Recognize a newline
Procedure IsNewline(s.s)
  ProcedureReturn ((s.s = #CR$) Or (s.s = #LF$))
EndProcedure

;Skip whitespace
Procedure EatWhite()
  While IsWhiteSpace(Look)
    GetChar()
  Wend
EndProcedure

;Skip newlines
Procedure EatLines()
  While IsNewline(Look)
    GetChar()
  Wend
EndProcedure

;Skip whitespace and newlines
Procedure EatBlank()
  While IsWhiteSpace(Look) Or IsNewline(Look)
    EatWhite()
    EatBlank() ;Removing this fixed it. (It goes into an infinite loop of course unless you replace with EatLines())
  Wend
EndProcedure

Stream = Input()+#CR$ : PrintN("")
GetChar()
EatBlank()
Input()