RESOLVED FIXED 140479
WeakPtr functions crash when created with default constructor
https://bugs.webkit.org/show_bug.cgi?id=140479
Summary WeakPtr functions crash when created with default constructor
Myles C. Maxfield
Reported 2015-01-14 16:28:07 PST
WeakPtr functions crash when created with default constructor
Attachments
Patch (6.74 KB, patch)
2015-01-14 16:46 PST, Myles C. Maxfield
no flags
Patch (16.36 KB, patch)
2015-01-14 18:19 PST, Myles C. Maxfield
no flags
Patch (16.69 KB, patch)
2015-01-16 09:49 PST, Myles C. Maxfield
no flags
Patch (15.66 KB, patch)
2015-01-16 11:29 PST, Myles C. Maxfield
no flags
Patch (16.38 KB, patch)
2015-01-16 12:19 PST, Myles C. Maxfield
no flags
Myles C. Maxfield
Comment 1 2015-01-14 16:46:25 PST
WebKit Commit Bot
Comment 2 2015-01-14 16:48:24 PST
Attachment 244662 [details] did not pass style-queue: ERROR: Source/WTF/wtf/WeakPtr.h:92: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/WTF/wtf/WeakPtr.h:101: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] Total errors found: 2 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Myles C. Maxfield
Comment 3 2015-01-14 18:19:26 PST
WebKit Commit Bot
Comment 4 2015-01-14 18:21:22 PST
Attachment 244672 [details] did not pass style-queue: ERROR: Source/WTF/wtf/WeakPtr.h:92: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/WTF/wtf/WeakPtr.h:101: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] Total errors found: 2 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Myles C. Maxfield
Comment 5 2015-01-14 20:59:33 PST
EFL is a false negative - it looks like the compiler was killed.
Myles C. Maxfield
Comment 6 2015-01-15 07:28:17 PST
Style is also a false negative - the style checker doesn't understand single line functions.
Andreas Kling
Comment 7 2015-01-15 11:22:22 PST
Comment on attachment 244672 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=244672&action=review > Source/WTF/wtf/WeakPtr.h:101 > + WeakPtr(Ref<WeakReference<T>> ref) : m_ref(ref) { } Shouldn't this be: WeakPtr(Ref<WeakReference<T>>&& ref) : m_ref(WTF::move(ref)) { }
Myles C. Maxfield
Comment 8 2015-01-15 15:48:06 PST
Comment on attachment 244672 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=244672&action=review >> Source/WTF/wtf/WeakPtr.h:101 >> + WeakPtr(Ref<WeakReference<T>> ref) : m_ref(ref) { } > > Shouldn't this be: > WeakPtr(Ref<WeakReference<T>>&& ref) : m_ref(WTF::move(ref)) { } I don't think so. I'm trying to copy the Ref that the caller uses when calling this function.
Anders Carlsson
Comment 9 2015-01-15 15:54:23 PST
(In reply to comment #8) > Comment on attachment 244672 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=244672&action=review > > >> Source/WTF/wtf/WeakPtr.h:101 > >> + WeakPtr(Ref<WeakReference<T>> ref) : m_ref(ref) { } > > > > Shouldn't this be: > > WeakPtr(Ref<WeakReference<T>>&& ref) : m_ref(WTF::move(ref)) { } > > I don't think so. I'm trying to copy the Ref that the caller uses when > calling this function. Then you should use copyRef() at the call site.
Myles C. Maxfield
Comment 10 2015-01-16 09:49:04 PST
WebKit Commit Bot
Comment 11 2015-01-16 09:50:53 PST
Attachment 244768 [details] did not pass style-queue: ERROR: Source/WTF/wtf/WeakPtr.h:92: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/WTF/wtf/WeakPtr.h:93: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/WTF/wtf/WeakPtr.h:102: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] Total errors found: 3 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Myles C. Maxfield
Comment 12 2015-01-16 11:29:35 PST
WebKit Commit Bot
Comment 13 2015-01-16 11:33:26 PST
Attachment 244779 [details] did not pass style-queue: ERROR: Source/WTF/wtf/WeakPtr.h:92: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/WTF/wtf/WeakPtr.h:93: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/WTF/wtf/WeakPtr.h:106: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] Total errors found: 3 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Myles C. Maxfield
Comment 14 2015-01-16 12:19:01 PST
WebKit Commit Bot
Comment 15 2015-01-16 12:21:46 PST
Attachment 244786 [details] did not pass style-queue: ERROR: Source/WTF/wtf/WeakPtr.h:92: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/WTF/wtf/WeakPtr.h:93: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/WTF/wtf/WeakPtr.h:106: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] Total errors found: 3 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Andreas Kling
Comment 16 2015-01-16 15:31:21 PST
Comment on attachment 244786 [details] Patch r=me We really should make more use of this class.
WebKit Commit Bot
Comment 17 2015-01-16 16:39:56 PST
Comment on attachment 244786 [details] Patch Clearing flags on attachment: 244786 Committed r178615: <http://trac.webkit.org/changeset/178615>
WebKit Commit Bot
Comment 18 2015-01-16 16:40:00 PST
All reviewed patches have been landed. Closing bug.
David Kilzer (:ddkilzer)
Comment 19 2016-03-12 13:01:33 PST
(In reply to comment #17) > Comment on attachment 244786 [details] > Patch > > Clearing flags on attachment: 244786 > > Committed r178615: <http://trac.webkit.org/changeset/178615> Build fix for GTK once patch in Bug 155394 lands (since WeakPtr.cpp was not added to Tools/TestWebKitAPI/CMakeLists.txt when this patch originally landed): Committed r198067. <http://trac.webkit.org/changeset/198067>
Note You need to log in before you can comment on or make changes to this bug.