RegExp not released on error path in createObjectNoStatics

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: mwu, Assigned: mwu)

Tracking

({mlk})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 527648 [details] [diff] [review]
Release RegExp on error
Attachment #527648 - Flags: review?(cdleary)
Comment on attachment 527648 [details] [diff] [review]
Release RegExp on error

Nice catch! Only nit is that I think SpiderMonkey style prefers combining with the above test a la:

    if (!obj ||
        !obj->initRegExp(cx, re.get())) {
        // common cleanup code
    }
Attachment #527648 - Flags: review?(cdleary) → review+
...except combine the two conditions to one line, like:

if (!obj || !obj->initRegExp(cx, re.get()))

because it all fits on one line, in 99ish characters.
(Assignee)

Comment 3

6 years ago
http://hg.mozilla.org/tracemonkey/rev/152ef9c8b2bb

Hm I forgot to make it one line.. sorry about that!

It looks sorta nice on two lines IMO anyway..
Whiteboard: fixed-in-tracemonkey
(Assignee)

Comment 4

6 years ago
http://hg.mozilla.org/mozilla-central/rev/152ef9c8b2bb
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.