Menu

#27 -token_ext-catch$__finally causes Access Violation

open
nobody
None
5
2015-02-07
2006-05-26
No

I work with C++ Builder source code, so I've added the
option

-token_ext-catch$__finally

in my GC.cfg and GC crashed (Access Violation).

I've debugged it and found that grammar.c, at lines
785~787, doesn't check for pnext before using pnext->
members.

Change it from:

785 if(SpecWord(pnext, TOKEN_W_IF))
786 {
787 while(pnext->StmtLevel > pcur->StmtLevel)

to

785 if(pnext && SpecWord(pnext, TOKEN_W_IF))
786 {
787 while(pnext && (pnext->StmtLevel > pcur->StmtLevel))

And it won't crash anymore,

-= BUT =-

it doesn't indent __finally the same way that catch...
Could you take a look at that?

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.