JS_InitClass with no methods or properties breaks JSScope::emptyScope invariant

RESOLVED FIXED

Status

()

RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: jorendorff, Assigned: jorendorff)

Tracking

Other Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed-in-tracemonkey])

Attachments

(1 attachment)

(Assignee)

Description

8 years ago
js_InitClass says:
3518	    if (!proto->scope()->ensureEmptyScope(cx, clasp))
3519	        goto bad;

without first ensuring that proto->scope() is mutable. This causes an assertion during GC in debug builds if you manually hack JS_SetGCZeal(cx, 2) into jsapi-tests/tests.h.

Easy patch coming.
(Assignee)

Comment 1

8 years ago
Created attachment 458470 [details] [diff] [review]
v1

(Locking here, because we may have called the constructor on this proto, which could have executed code on another context or whatever.)
Assignee: general → jorendorff
Attachment #458470 - Flags: review?(brendan)
Comment on attachment 458470 [details] [diff] [review]
v1

Hurt me with more conflicts in my mq for bug 558451 -- all good ;-).

/be
Attachment #458470 - Flags: review?(brendan) → review+
(Assignee)

Comment 3

8 years ago
http://hg.mozilla.org/tracemonkey/rev/7fd49595dc3a
Whiteboard: [fixed-in-tracemonkey]

Comment 4

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