Bug 70073 - [Scanner] Unmatched #elif causes the parser to prematurely exit
Summary: [Scanner] Unmatched #elif causes the parser to prematurely exit
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Andrew Niefer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-14 18:46 EDT by Mas Yokota CLA
Modified: 2004-08-12 15:49 EDT (History)
1 user (show)

See Also:


Attachments
test case (490 bytes, text/plain)
2004-07-14 18:46 EDT, Mas Yokota CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.