Bug 44989 - Make PassRefPtr complain if you use them after they are released
Summary: Make PassRefPtr complain if you use them after they are released
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Anders Carlsson
Depends on:
Reported: 2010-08-31 14:37 PDT by Darin Adler
Modified: 2010-08-31 17:50 PDT (History)
1 user (show)

See Also:

Patch (7.95 KB, patch)
2010-08-31 17:50 PDT, Anders Carlsson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2010-08-31 14:37:39 PDT
Anders had a great idea: Once you pass the value of a PassRefPtr you should get an assertion if you try to use it. Idiomatically, we don’t use PassRefPtr after passing its value along. Its value is zero then, but in debug versions it could instead have a “known bad” value so we can catch incorrect uses.

RefPtr could use the same feature. As could PassOwnPtr and OwnPtr.
Comment 1 Anders Carlsson 2010-08-31 17:50:17 PDT
Created attachment 66153 [details]

Here's a patch that does this for PassRefPtr. One thing we should figure out if it's valid to assign into a pointer that has been released. (See the editing change)