Closed Bug 48464 Opened 25 years ago Closed 25 years ago

auto-generated |operator=| interfering with string usage

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: scc, Assigned: scc)

Details

Attachments

(2 files)

...we didn't notice this until vidur and jst started passing around readable and writable references. We had already noticed this and fixed it (some time ago) in |ns[C]String| and subclasses. The basic problem is that even if you supply _other_ |operator=|s, if you don't specifically declare the one that is the copy- assignment operator, the compiler will auto-generate one for you. |nsAReadableString| shouldn't have one at all (since it's immutable). The one that gets generated for |nsAWritableString| does nothing (since writable has no concrete state), but that's bad if this one gets picked for an assignment instead of one of the ones that does work ... which is what happened.
this builds and runs in my tests (adding new tests to account for the problem), just need r= and a=
Status: NEW → ASSIGNED
the code from the patch is fine, there are a couple of small changes I want to make to some of the comments though
For a= purposes, in case I didn't mention: this bug blocks vidur and jst's work on converting the DOM APIs.
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
please verify
Marking Verified. Please reopen if problem reoccurs.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: