[Webkit-unassigned] [Bug 23014] Virtual destructors missing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Dec 28 16:04:22 PST 2008


https://bugs.webkit.org/show_bug.cgi?id=23014


barraclough at apple.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |barraclough at apple.com




------- Comment #1 from barraclough at apple.com  2008-12-28 16:04 PDT -------
Hmm, I'm not sure this tool is saying much interesting – the bulk of the cases
are in the parse tree, and I believe the destructors will all already be
virtual by virtue of the ParserRefCounted destructor being virtual (I'd have to
check the spec & do a quick audit of the code, but I'm pretty confident our
behavior is all correct here).  In the longer term it is likely that we will be
moving in quite the opposite direction – that all parse nodes will be pool
allocated, so no destructors will be called at all.  Probably worth checking,
but I don't think there is a problem here right now, and I doubt we want to be
littering the code with more virtual destructors if it is unnecessary to do so.

The CodeBlock case is a sufficiently trivial hierarchy that this is not a real
concern.  There are only three classes, and there is one place that each is
referenced, always with a pointer of the specific type.  That said, the code
could be cleaned up a little to make it a little more obvious what is going on
(the hierarchy is a little asymmetric at the minute; I think it'd be clearer if
EvalCodeBlock didn't inherit from ProgramCodeBlock, and if we added a
FunctionCodeBlock type, too).  Or we could possibly move the marking up the the
ProgramNode/EvalNode so we can remove m_globalObject, and we could unify the
CodeBlock types.

I can't comment on the JSVariableObject case, I'll have to look at this, but my
guess would be like like CodeBlock this is an example of inheritance for reuse,
rather than a true virtual inheritance hierarchy.

Unless anyone else pipes up on this, I'll probably assign this bug to myself &
look into checking / fixing a couple of these things when I get a chance.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list