It is currently Tue Oct 22, 2019 8:57 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: IDE crash when opening procedure callstack (certain conditio
PostPosted: Tue Oct 11, 2005 1:57 pm 
Offline
Always Here
Always Here

Joined: Mon Sep 22, 2003 6:45 pm
Posts: 7439
Location: Norway
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:
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()


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye