bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-indent] Segmentation fault when indenting strange file


From: Ralf Engels
Subject: [Bug-indent] Segmentation fault when indenting strange file
Date: Sun, 30 Jan 2005 00:31:27 -0000

Hi,
while testing my Maki decompiler I made an error and tried to indent a debug 
output.
You can imagine my surprise when I noticed that indent failed with a 
segmentation fault.

It didn't take long to notice that there is an error in function 
handle_token_colon line 878ff when adding something to an array (sorry, no 
comments can be found there).

I fixed it by adding check_lab_size as you can see some lines further in 
handle_token_preesc.

I think that further errors could be lurking around line 1720 where again 
*e_lab++ without check_lab_size.


Proposal:
1: write a function 

void add_label( char* label ) {
        check_lab_size();
        *e_lab++ = label;
}

and replace all direct *e_lab access.

2: Add some comments


BR,
Ralf

(PS: attached the file producing the error, the patch fixing it.)

Attachment: error.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]