RESOLVED FIXED122742
Reintroduce PassRefPtr<Event> copy in ScopedEventQueue::dispatchEvent
https://bugs.webkit.org/show_bug.cgi?id=122742
Summary Reintroduce PassRefPtr<Event> copy in ScopedEventQueue::dispatchEvent
Zan Dobersek
Reported 2013-10-14 01:44:28 PDT
Reintroduce PassRefPtr<Event> copy in ScopedEventQueue::dispatchEvent
Attachments
Patch (3.00 KB, patch)
2013-10-14 02:11 PDT, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2013-10-14 02:11:34 PDT
Alberto Garcia
Comment 2 2013-10-14 02:30:27 PDT
lgtm
Zan Dobersek
Comment 3 2013-10-14 08:43:58 PDT
Comment on attachment 214136 [details] Patch Clearing flags on attachment: 214136 Committed r157401: <http://trac.webkit.org/changeset/157401>
Zan Dobersek
Comment 4 2013-10-14 08:44:04 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 5 2013-10-14 10:05:07 PDT
Comment on attachment 214136 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=214136&action=review > Source/WebCore/dom/ScopedEventQueue.cpp:86 > + // Passing the PassRefPtr<Event> object into the method call creates a new copy and also nullifies > + // the original object, which is causing crashes in GCC-compiled code that only after that goes on > + // to retrieve the Event's target, calling Event::target() on the now-null PassRefPtr<Event> object. > + Node* node = event->target()->toNode(); > + EventDispatcher::dispatchEvent(node, event); This is a totally confusing comment. The bug is no surprise. If we put the node computation into the function call we’d be depending on undefined behavior. But the comment should say something more like this: // Put node in local variable to make sure we don’t dereference the event after it's nulled out to pass it in. The mentions of things like "create a new copy" and "crashes in GCC-compiled code" make the comment just landed confusing and it's *so* long for such a minor issue.
Note You need to log in before you can comment on or make changes to this bug.