| Summary: | CachedRefPtr should adoptRef before calling ref to appease RefCounted's debug assertions | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Ryan Haddad <ryanhaddad> | ||||||
| Component: | JavaScriptCore | Assignee: | Saam Barati <saam> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | darin, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bot-watchers-bugzilla, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=219909 | ||||||||
| Attachments: |
|
||||||||
|
Description
Ryan Haddad
2020-12-16 10:57:46 PST
Created attachment 416531 [details]
patch
Comment on attachment 416531 [details]
patch
r=me
Comment on attachment 416531 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=416531&action=review > Source/JavaScriptCore/runtime/CachedTypes.cpp:560 > + RefPtr<Source, PtrTraits> result = adoptRef(decodedPtr); Two related questions: 1) Is it OK that this calls adoptRef without template arguments rather than calling adoptRef<Source, PtrTraits>? 2) Would you consider using auto here instead of writing out the RefPtr type? (In reply to Darin Adler from comment #5) > Comment on attachment 416531 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=416531&action=review > > > Source/JavaScriptCore/runtime/CachedTypes.cpp:560 > > + RefPtr<Source, PtrTraits> result = adoptRef(decodedPtr); > > Two related questions: > > 1) Is it OK that this calls adoptRef without template arguments rather than > calling adoptRef<Source, PtrTraits>? Probably not. Good call, I will fix. This is probably fine for the particular types we currently use it for, but it'd probably not work for future types that make use of non default PtrTraits. > 2) Would you consider using auto here instead of writing out the RefPtr type? Auto seems ok Created attachment 416547 [details]
patch for landing
Committed r270991: <https://trac.webkit.org/changeset/270991> All reviewed patches have been landed. Closing bug and clearing flags on attachment 416547 [details]. |