Closed
Bug 458098
Opened 16 years ago
Closed 16 years ago
js_DumpObject can't handle objects that share proto's scope
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: jorendorff, Assigned: jorendorff)
References
Details
Attachments
(1 file)
2.79 KB,
patch
|
crowderbt
:
review+
|
Details | Diff | Splinter Review |
Objects with no 'own properties' share their proto's scope; calling js_DumpObject on such an object can crash because the object doesn't have the slots that the scope describes. With the patch, it'll print "no own properties - see proto". (trivial) The patch also adds a newline that was missing before.
Attachment #341314 -
Flags: review?(crowder)
Updated•16 years ago
|
Attachment #341314 -
Flags: review?(crowder) → review+
Comment 1•16 years ago
|
||
Comment on attachment 341314 [details] [diff] [review] fix >diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp >+ sharesScope = (proto && scope == OBJ_SCOPE(proto)); Drive-by question: this could also be written as 'sharesScope = scope->obj == obj;' right?
Comment 2•16 years ago
|
||
(In reply to comment #1) > (From update of attachment 341314 [details] [diff] [review]) > >diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp > >+ sharesScope = (proto && scope == OBJ_SCOPE(proto)); > > Drive-by question: this could also be written as 'sharesScope = scope->obj == > obj;' right? That's the faster way (and clearer, maybe) way to test. /be
Assignee | ||
Comment 3•16 years ago
|
||
I changed that line to say sharesScope = (scope->obj != obj); http://hg.mozilla.org/mozilla-central/rev/765855ec09b0
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Flags: in-testsuite-
Flags: in-litmus-
You need to log in
before you can comment on or make changes to this bug.
Description
•