FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Infinite Loop Bug

 
Post new topic   Reply to topic     Forum Index -> Code Analyzer
View previous topic :: View next topic  
Author Message
Kuan Hsu



Joined: 15 Apr 2006
Posts: 143
Location: Taiwan

PostPosted: Sun Aug 13, 2006 10:55 am    Post subject: Infinite Loop Bug Reply with quote

When parse incorrect string:
Code:

module tests;

void main()
{
   char[] word = "dd;
}


Above code lacks back ", the Infinite Loop occurs. In Poseidon, I modify scanOldSchool function in string.d:
Code:


//while( sc.peek() != bound )
while( sc.peek() != bound && !sc.reachedEnd() )
{
   char c = sc.read();
   if( c == '\\' ) //skip escape sequence, as it may containg a 'bound'
   {
      sc.read();
   }
}


then it seems to work in old rev.19, I'm not sure the bug exist in rev.31 or not( I use DMD0.162 ).

Keep nice work, Thanks!!! Very Happy
Back to top
View user's profile Send private message Send e-mail
hasan



Joined: 02 May 2005
Posts: 58

PostPosted: Tue Aug 15, 2006 5:29 am    Post subject: Reply with quote

Thanks for the report, I think there are many occurances of this kind of bug (not checking for end of text ..)

I'm on a journey right now, so can't do anything for about a month or so.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Code Analyzer All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group