Closed Bug 280089 Opened 21 years ago Closed 21 years ago

[FIX]Add debug-only mCompiled members to XBL classes that care

Categories

(Core :: XBL, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8beta1

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(3 files)

Some XBL classes have a union that holds different things for compiled and uncompiled members. This bug is about adding a debug-only member to make sure that we're not getting confused about whether we're compiled. See discussion in bug 275232. Note that when working on this I found a simple way to make properties crash due to precisely this issue. The patch will fix that.
Attached file XBL for crash testcase —
Attached file Crash testcase —
Attached patch Patch — — Splinter Review
This adds the asserts, fixes the crash that the testcase shows, and fixes a bug in nsXBLProtoImpl caught by the asserts.
Attachment #172601 - Flags: superreview?(bryner)
Attachment #172601 - Flags: review?(bryner)
Priority: -- → P1
Summary: Add debug-only mCompiled members to XBL classes that care → [FIX]Add debug-only mCompiled members to XBL classes that care
Target Milestone: --- → mozilla1.8beta
Comment on attachment 172601 [details] [diff] [review] Patch >--- content/xbl/src/nsXBLProtoImplProperty.cpp 16 Sep 2004 18:30:04 -0000 1.16 >+++ content/xbl/src/nsXBLProtoImplProperty.cpp 27 Jan 2005 21:08:54 -0000 >@@ -237,25 +256,33 @@ nsXBLProtoImplProperty::CompileMember(ns > mJSGetterObject = nsnull; > mJSAttributes &= ~JSPROP_GETTER; > /*chaining to return failure*/ > } > } > } // if getter is not empty > > if (!deletedGetter) { // Empty getter > delete mGetterText; > mJSGetterObject = nsnull; > } > >- nsresult rvG=rv; >+ if (NS_FAILED(rv)) { >+ // We failed to compile our getter. So either we've set it to null, or >+ // it's still set to the text object. In either case, it's safe to return >+ // the error her, since then we'll be cleaned up as uncompiled and that s/her/here/ Looks fine otherwise.
Attachment #172601 - Flags: superreview?(bryner)
Attachment #172601 - Flags: superreview+
Attachment #172601 - Flags: review?(bryner)
Attachment #172601 - Flags: review+
Checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: