[webkit-reviews] review granted: [Bug 161947] null m_lastNodeInserted dereference at ReplaceSelectionCommand::InsertedNodes::lastLeafInserted : [Attachment 334010] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 19 13:40:01 PST 2018


Ryosuke Niwa <rniwa at webkit.org> has granted  review:
Bug 161947: null m_lastNodeInserted dereference at
ReplaceSelectionCommand::InsertedNodes::lastLeafInserted
https://bugs.webkit.org/show_bug.cgi?id=161947

Attachment 334010: Patch

https://bugs.webkit.org/attachment.cgi?id=334010&action=review




--- Comment #24 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 334010
  --> https://bugs.webkit.org/attachment.cgi?id=334010
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=334010&action=review

>>> Source/WebCore/editing/ReplaceSelectionCommand.h:72
>>> +	     bool isEmpty() { return !m_firstNodeInserted; }
>> 
>> This is not right. m_firstNodeInserted should never be null because we keep
updating m_firstNodeInserted in willRemoveNode and didReplaceNode.
>> If m_firstNodeInserted is null, that's a bug elsewhere.
> 
> Yes, m_firstNodeInserted is updated in willRemoveNode.
> Here is the code of willRemoveNode:
> 
>
https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/editing/ReplaceSele
ctionCommand.cpp?rev=228482#L355

Hm... I must have misremembered this. Okay.


More information about the webkit-reviews mailing list