Closed
Bug 1242789
Opened 8 years ago
Closed 8 years ago
Allow lambdas capturing raw pointers to refcounted objects *by reference*
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Developer Infrastructure
Source Code Analysis
Tracking
(firefox47 fixed)
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: botond, Assigned: nika)
References
Details
Attachments
(1 file)
3.16 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
In bug 1153304, we introduced a static analysis to prevent lambdas from capturing raw pointers to refcounted objects. The idea was to avoid scenarios where the the captured raw pointer outlives the function in which the lambda is created (e.g. because a copy of the lambda is stored somewhere that outlives the function). :jgilbert pointed out in bug 1201275 comment 4 that this check doesn't have much value in the case where the raw pointer is being captured *by reference*. In such a case, the correctness of the code is already predicated on the lambda not outliving the original raw pointer variable, so forcing that variable to have type RefPtr doesn't add any safety. I'd like to propose modifying the static analysis to allow this case. Thoughts?
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8711962 -
Flags: review?(ehsan)
Assignee | ||
Comment 2•8 years ago
|
||
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ed8e8c713011
Assignee: nobody → michael
Updated•8 years ago
|
Attachment #8711962 -
Flags: review?(ehsan) → review+
Comment 4•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8e3441257c01
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Updated•6 years ago
|
Product: Core → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•