auto-generated |operator=| interfering with string usage

VERIFIED FIXED

Status

()

Core
XPCOM
P3
normal
VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: Scott Collins, Assigned: Scott Collins)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

18 years ago
...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.
(Assignee)

Comment 1

18 years ago
Created attachment 12703 [details] [diff] [review]
adding appropriate signatures, and commenting things better
(Assignee)

Comment 2

18 years ago
this builds and runs in my tests (adding new tests to account for the problem), 
just need r= and a=
Status: NEW → ASSIGNED
(Assignee)

Comment 3

18 years ago
the code from the patch is fine, there are a couple of small changes I want to 
make to some of the comments though
(Assignee)

Comment 4

18 years ago
Created attachment 12704 [details] [diff] [review]
fixes typos and respects the difference between 'default' and 'auto-generated'
(Assignee)

Comment 5

18 years ago
For a= purposes, in case I didn't mention: this bug blocks vidur and jst's work 
on converting the DOM APIs.
(Assignee)

Comment 6

18 years ago
fix checked in
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 7

18 years ago
please verify

Comment 8

18 years ago
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.