Closed Bug 112974 Opened 24 years ago Closed 23 years ago

inheriting proto's map does not take into account JSCLASS_HAS_PRIVATE

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.0.2

People

(Reporter: jband_mozilla, Assigned: brendan)

References

Details

(Keywords: js1.5)

Attachments

(2 files)

This is from the newsgroup. news://news.mozilla.org:119/3C05ABA3.2F69447F@emsoftltd.com I confirmed this. I'll attach a sample C file (can be put in place of js.c to build easily). The problem does not show up if JS_InitStandardClasses is called on the global before it is used as the proto because its slot count is changed quite a bit from its initial state. But when using the global resolve hook stuff the global is left in its initial state and the map is not sufficient for later expectations as used in the second object. This same problem would occur if some other plain JS object were used as the proto. I'm going to wimp out and not propose a fix at this point.
Attached file test C file
Summary: inheriting proto's map does take into account JSCLASS_HAS_PRIVATE → inheriting proto's map does not take into account JSCLASS_HAS_PRIVATE
Reassigning to Kenton; cc'ing Roger -
Assignee: rogerl → khanson
I'll help in 0.9.9. /be
targeting 9.9.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.9
Target Milestone: mozilla0.9.9 → mozilla1.0.1
This is something I really should considef for mozilla1.0/js1.5. /be
Assignee: khanson → brendan
Status: ASSIGNED → NEW
Keywords: js1.5, mozilla1.0
Target Milestone: mozilla1.0.1 → mozilla1.0
Status: NEW → ASSIGNED
Keywords: mozilla1.0mozilla1.0.1
Target Milestone: mozilla1.0 → mozilla1.0.1
do we still want to go for this in 1.0.1?
Blocks: 149801
Moving out a bit. The js1.5 release (after an rc5 release candidate) should come off off the 1.0 branch on or before 1.0.2 freezing, I say. The trunk and branch should be in sync for js/src/js*.[chmt]* and build files. /be
Keywords: mozilla1.0.1mozilla1.2
Target Milestone: mozilla1.0.1 → mozilla1.0.2
Attached patch proposed fixSplinter Review
Don't share the prototype's map if the new object's class and the prototype's class do not have the same slot-allocating flag bits (JSCLASS_HAS_PRIVATE and the reserved slots field). This fixes jband's reduced testcase, and makes sense. Looking for r= and sr= pretty soon. Thanks, /be
Comment on attachment 93330 [details] [diff] [review] proposed fix r=rogerl
Attachment #93330 - Flags: review+
Attachment #93330 - Flags: superreview+
Comment on attachment 93330 [details] [diff] [review] proposed fix sr=jband. A comment wouldn't hurt.
Fixed on the trunk. Another one for the eventual js1.5 landing on the 1.0 branch.... /be
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified Fixed On WinNT, Linux, I built the JS shell using jband's C testcase above in place of js.c. Before the fix for this bug, I experienced: WINNT debug, opt shell both crashed on startup LINUX debug shell crashed on startup (but opt shell did not: why?) After this fix, the testcase passed; i.e. I got no crash on startup in either debug or optimized mode, on WinNT or Linux -
Status: RESOLVED → VERIFIED
Flags: testcase-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: