Summary: | [Parser] Callbacks can become unbalanced on errors | ||
---|---|---|---|
Product: | [Tools] CDT | Reporter: | Andrew Niefer <aniefer> |
Component: | cdt-parser | Assignee: | John Camelon <john.camelon> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | P2 | CC: | dave.daoust, keithc, khapitas |
Version: | 2.0 | ||
Target Milestone: | 2.0.1 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Andrew Niefer
2004-06-24 14:44:08 EDT
I will investigate, this may not make it into 2.0, it could be a bit risky. Irregardless, Search requestor should clean itself up. This affects any ISourceElementRequestor enter/exit callbacks. There's a few cases to think about: 1. Parse within a scope { } fails, and error handling causes us to fall outside of where the final '}' is: for this, we need to make the errorHandling aware of what type of scope it is trying to handle out of. This will require the parser keeping track of {'s and }'s as we recursively decend. 2. Catastrophic failure requires something a bit more precise, like perhaps 'undoing' a previous callback. This cannot be fixed for 2.0. Setting to Future. Setting milestone to 2.0.l ... Fix has been applied to HEAD, along w/JUnit test cases to validate them. When we merge this with the 2.0.1 branch I shall mark the defect as resolved. Description of Solution: The parser communicates to the client through a callback. My fix uses Java "try{} finally{}" blocks to guarrantee that for every enter() call to the callback, there shall be an exit() call corresponding to it. The merge from HEAD to 2_0 branch is complete. JUnits validating these fixes have been committed to both branches. Marking as RESOLVED - FIXED. The next available 2.0.1 build shall contain these fixes along with Parser performance/scalability improvements. |