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.
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)