Re: Audit your code if you use mozilla::WeakPtr

2013-10-08 Thread Boris Zbarsky
On 10/8/13 10:32 PM, Justin Dolske wrote: Would that be a kungFuDeathGrep? (Sorry. Just making weak pun.) You mean mozilla::WeakpPun? -Boris ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform

Re: Audit your code if you use mozilla::WeakPtr

2013-10-08 Thread Justin Dolske
On 10/8/13 6:04 PM, Ehsan Akhgari wrote: This code pattern is another problem -- you need to keep object alive if you want to do this some other way. We have an idiom for this kind of thing in fact (grep for kungFuDeathGrip!) Would that be a kungFuDeathGrep? (Sorry. Just making weak pun.) Ju

Re: Audit your code if you use mozilla::WeakPtr

2013-10-08 Thread Ehsan Akhgari
My proposal is to remove those operators altogether, so this will be moot. Cheers, Ehsan -Jeff - Original Message - From: "David Major" To: "Ehsan Akhgari" Cc: dev-platform@lists.mozilla.org Sent: Tuesday, October 8, 2013 4:38:24 PM Subject: Re: Audit your code if

Re: Audit your code if you use mozilla::WeakPtr

2013-10-08 Thread Ehsan Akhgari
grep for kungFuDeathGrip!) - Original Message - From: "Ehsan Akhgari" To: "David Major" Cc: dev-platform@lists.mozilla.org Sent: Tuesday, October 8, 2013 4:27:03 PM Subject: Re: Audit your code if you use mozilla::WeakPtr On 2013-10-08 7:10 PM, David Major wrote: Is

Re: Audit your code if you use mozilla::WeakPtr

2013-10-08 Thread Jeff Gilbert
ct = foo.get(); if (object) { object->Method(); } // ... A lot of stuff happens and the ref blows up ... if (object) { object->Method(); // oops } - Original Message - From: "Ehsan Akhgari" To: "David Major" Cc: dev-platform@lists.mozilla.org Sent: Tuesday, Oc

Re: Audit your code if you use mozilla::WeakPtr

2013-10-08 Thread David Major
of stuff happens and the ref blows up ... if (object) { object->Method(); // oops } - Original Message - From: "Ehsan Akhgari" To: "David Major" Cc: dev-platform@lists.mozilla.org Sent: Tuesday, October 8, 2013 4:27:03 PM Subject: Re: Audit your code if you use mo

Re: Audit your code if you use mozilla::WeakPtr

2013-10-08 Thread Ehsan Akhgari
From: "Ehsan Akhgari" To: dev-platform@lists.mozilla.org Sent: Tuesday, October 8, 2013 3:54:17 PM Subject: Audit your code if you use mozilla::WeakPtr I and Benoit Jacob discovered a bug in WeakPtr (bug 924658) which makes its usage unsafe by default. The issue is that WeakPtr prov

Re: Audit your code if you use mozilla::WeakPtr

2013-10-08 Thread David Major
weak->act(); * } - Original Message - From: "Ehsan Akhgari" To: dev-platform@lists.mozilla.org Sent: Tuesday, October 8, 2013 3:54:17 PM Subject: Audit your code if you use mozilla::WeakPtr I and Benoit Jacob discovered a bug in WeakPtr (bug 924658) which makes its usage uns

Audit your code if you use mozilla::WeakPtr

2013-10-08 Thread Ehsan Akhgari
I and Benoit Jacob discovered a bug in WeakPtr (bug 924658) which makes its usage unsafe by default. The issue is that WeakPtr provides convenience methods such as operator->, which mean that the consumer can directly dereference it without the required null checking first. This means that you ca