[Webkit-unassigned] [Bug 19286] ReadModifyResolveNode(PlacementNewAdoptType) needlessly initializes a member

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 28 07:25:25 PDT 2008


http://bugs.webkit.org/show_bug.cgi?id=19286





------- Comment #3 from pepe at sed.inf.u-szeged.hu  2008-05-28 07:25 PDT -------
(In reply to comment #1)
> I would say that to the contrary, it is a mistake that it initializes a member
> - this constructor is supposed to be a no-op, only necessary to allocate memory
> to be later used for placement new.
> 

It is a public constructor. Even though it is used currently only for
allocating memory, nobody can guarantee that it will never be used accidentally
in the future. And if it happens it could lead to undetermined behaviour.
Please also check the other constructor of this class, which does not
initialize the 'm_index' member.
        ReadModifyResolveNode(const Identifier& ident, Operator oper,
ExpressionNode*  right, bool rightHasAssignm
            : m_ident(ident)
            , m_right(right)
            , m_operator(oper)
            , m_rightHasAssignments(rightHasAssignments)
        {
        }


-- 
Configure bugmail: http://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