Closed Bug 1609133 Opened 5 years ago Closed 4 years ago

Add a check to clang-plugin identifying unsafe acquisitions of a raw pointer into a RefPtr

Categories

(Developer Infrastructure :: Source Code Analysis, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: sg, Assigned: sg)

Details

Attachments

(1 obsolete file)

A check should be added to clang-plugin identifying unsafe acquisitions of a raw pointer into a RefPtr.

The cases which are most unsafe still need to be determined, e.g. acquiring a RefPtr from a member raw pointer. These uses are not necessarily wrong, but should be made more explicit, e.g. by at least adding a do_addRef rather than an implicit assignment.

The check needs to be made aware of the template instantiation stack to provide meaningful diagnostics.

Assignee: nobody → sgiesecke

I am not sure if this should be pursued anymore. We have added https://searchfox.org/mozilla-central/rev/4bb2401ecbfce89af06fb2b4d0ea3557682bd8ff/dom/indexedDB/SafeRefPtr.h to catch this better at the type level. Maybe static analysis can be picked up again in the future to amend this, but for now I am closing this issue.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
Attachment #9121055 - Attachment is obsolete: true
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: