GC delete operator should be resilient to NULL

RESOLVED FIXED in Q3 11 - Serrano

Status

Tamarin
Garbage Collection (mmGC)
P2
normal
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Tommy Reilly, Assigned: Tommy Reilly)

Tracking

unspecified
Q3 11 - Serrano
Bug Flags:
flashplayer-bug +

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
It currently calls FreeNotNull which seems wrong, unless the C++ compiler generates the NULL check?

Comment 1

7 years ago
IMO operator delete should not be resilient to NULL, because GC::Free is not allowed on a NULL pointer by long-standing tradition.

Comment 2

7 years ago
(In reply to comment #1)
> IMO operator delete should not be resilient to NULL, because GC::Free is not
> allowed on a NULL pointer by long-standing tradition.

Actually that's a ludicrous claim.

Anyway:

I thought the delete operator would only be invoked on non-NULL pointers and I thought I checked that when I wrote the code.  But I've not yet found prose in the C++ spec to back me up on that.
(Assignee)

Comment 3

7 years ago
The compiler does not do a NULL check and the default delete operator handles NULL.

Updated

7 years ago
Blocks: 615490

Comment 4

7 years ago
C++ operator delete explicitly allows NULL pointers, so any "delete" we offer should probably do so as well, to re-use brainprint.
(Assignee)

Updated

7 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 5

7 years ago
Created attachment 508769 [details] [diff] [review]
allow null arg to delete

Ruchi needs this to complete her audit changes.
Assignee: nobody → treilly
Attachment #508769 - Flags: review?(lhansen)

Updated

7 years ago
Attachment #508769 - Flags: review?(lhansen) → review+
(Assignee)

Updated

7 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED

Comment 6

7 years ago
changeset: 5859:485ac738ec90
user:      Tommy Reilly <treilly@adobe.com>
summary:   [Bug 629391] GC delete operator should be resilient to NULL (r=lhansen)

http://hg.mozilla.org/tamarin-redux/rev/485ac738ec90

Updated

7 years ago
Flags: flashplayer-bug+
You need to log in before you can comment on or make changes to this bug.