Bug with reused binding levels

Frank Heckenbach frank@g-n-u.de
Sun Mar 2 14:51:00 GMT 2003


While debugging a GPC bug, I found a problem that also seems to
exist in the C frontend (at least in 3.2.2).

When a binding level is popped (poplevel), it's added to
free_binding_level, without being cleared. When it's reused as a
label level (push_label_level), only the fields relevant for label
levels are cleared (unlike the case when it's reused as a normal
binding level, pushlevel: `*newlevel = clear_binding_level'). So
label levels may contain old and invalid fields (which may even have
been GCed in the meantime while the level was in
free_binding_level). But marking the label level
(mark_binding_level) will try to mark these invalid fields because
it doesn't check if the level is a normal or a label level. (In my
case, it was `blocks' that caused a crash.)

An easy fix would be to completely clear reused label levels, of
course.

Frank

-- 
Frank Heckenbach, frank@g-n-u.de
http://fjf.gnu.de/
GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E)



More information about the Gcc-bugs mailing list