Changeset 157219 in webkit
- Timestamp:
- Oct 10, 2013, 6:29:54 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
dom/ScopedEventQueue.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r157216 r157219 1 2013-10-10 Zan Dobersek <zdobersek@igalia.com> 2 3 REGRESSION(r157210): Crashes in WebCore::ScopedEventQueue::dispatchEvent for platforms using GCC 4 https://bugs.webkit.org/show_bug.cgi?id=122592 5 6 Reviewed by Gustavo Noronha Silva. 7 8 * dom/ScopedEventQueue.cpp: 9 (WebCore::ScopedEventQueue::dispatchEvent): When calling EventDispatcher::dispatchEvent(), the GCC-compiled code 10 first creates a copy of the PassRefPtr<Event> object that's being passed into the method call. The copy will be used 11 in that method while the original is left with a null pointer. Only after that is the original queried for its pointer 12 while trying to get the Event's target, resulting in a crash due to calling the Event::target() on a null pointer. 13 To avoid it, pass a naked Event pointer to the method call. This will create a new PassRefPtr object without nullifying 14 the original one. 15 1 16 2013-10-10 Andreas Kling <akling@apple.com> 2 17 -
trunk/Source/WebCore/dom/ScopedEventQueue.cpp
r157203 r157219 80 80 { 81 81 ASSERT(event->target()); 82 EventDispatcher::dispatchEvent(event->target()->toNode(), event); 82 // Passing a naked Event pointer instead of the PassRefPtr<Event> prevents the PassRefPtr copy 83 // that nullifies the original PassRefPtr. This prevents crashes on GCC-compiled code since 84 // GCC creates the copy first, which leaves the event->target() call to be made on a null pointer. 85 EventDispatcher::dispatchEvent(event->target()->toNode(), event.get()); 83 86 } 84 87
Note:
See TracChangeset
for help on using the changeset viewer.