You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Florian Garbe has reported a similar problem which I have integrated as patch in the NoDeadNode branch.
The problem (at least this instance) comes from the strategyA heuristic in the parser. The heuristic creates an optional node and works fine by itself, but if another entry follows for which the heuristic doesn't work, it splits the parse result, creating two lists. The split result then contains the prior results twice and in one version some results may be empty.
I've submitted a patch 18fdcc0 that fixes this issue. Unfortunately it doesn't fix all problems of this kind and it slows down the parser significantly (needs more SAT checks), such that test rz1000.pi no longer parses in reasonable time.
As a consequence, I've not merged the patch into the master branch. It seems easier to live with dead nodes and eliminate them in a preprocessing step or ignore them in the analysis than slow down the parser for an (apparently only partial) solution.
Parsing the following code creates dead AST nodes:
void foo(
#ifdef A
int a
#else
double a
#endif
) { }
After parsing and pretty printing the result:
void foo
if definedEx(A)
(int a)
endif
if !definedEx(A)
(
if definedEx(A)
int <- Int specifier is dead!
endif
double a)
endif
{
}
The text was updated successfully, but these errors were encountered: