Bug 70073

Summary: [Scanner] Unmatched #elif causes the parser to prematurely exit
Product: [Tools] CDT Reporter: Mas Yokota <myokota>
Component: cdt-parserAssignee: Andrew Niefer <aniefer>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.camelon
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
test case none

Description Mas Yokota CLA 2004-07-14 18:46:29 EDT
Unmatched #elif causes the parser to prematurely exit due to an 
EmptyStackException exception.
e.g.
#if CONST
#endif
#elif CONST
Comment 1 Mas Yokota CLA 2004-07-14 18:46:57 EDT
Created attachment 13279 [details]
test case
Comment 2 John Camelon CLA 2004-07-15 11:16:50 EDT
These defects will be addressed once we move to the new Scanner implementation 
we are working on in the HEAD.
Comment 3 John Camelon CLA 2004-08-10 11:03:23 EDT
This needs some investigation in the 2.0.1 timeframe.  
Scanner2 skips over the rest of the file, which is effectively, like 
terminating the parse.  
Andrew, pls investigate ... if it is too big of a fix, push it off to Future.
Comment 4 Andrew Niefer CLA 2004-08-12 15:49:36 EDT
I added some lightweight branch state checking, so now when we encounter an 
unmatached preprocessor branch directive, we flag it with a problem and ignore 
it.