Closed
Bug 488858
Opened 17 years ago
Closed 16 years ago
List isn't copy safe
Categories
(Tamarin Graveyard :: Virtual Machine, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
flash10.1
People
(Reporter: treilly, Assigned: lhansen)
Details
Attachments
(1 file)
|
429 bytes,
patch
|
stejohns
:
review+
|
Details | Diff | Splinter Review |
Attachments:
Hi Tommy -
I was debugging a crash and noticed that someone had incorrectly written:
struct blah {}; // unmanaged
class foo : MMgc::GCFinalizedObject
{
avmplus::List<blah*> m_list;
void set(const amvplus::List<blah*> otherList)
{
m_list = otherList; // WRONG, no operator=
}
void set2(const avmplus::List<blah*> otherList)
{
m_list.clear();
m_list.add(otherList); // RIGHT
}
};
The symptom was hard to identify at first - m_list.data was double-freed because the automatically provided bitwise-copy operator= just duplicated the data pointer. Poisoned memory helped me figure it out (thank you).
What I'm wondering is: should we make it a compile error to use operator= with avmplus::List? Presumably by providing a private operator=? I'd be happy to do the work (easy), but I'm not sure what the procedure is for getting something into avmplus, and also I could be missing some reason why this is a dumb idea.
Thanks
d.
| Reporter | ||
Comment 1•17 years ago
|
||
we either need a copy ctor that makes a copy or make it private and force client to use add
Comment 2•17 years ago
|
||
vote for compile error
| Assignee | ||
Comment 3•16 years ago
|
||
vote for compile error
Assignee: nobody → lhansen
Target Milestone: --- → flash10.x
Comment 4•16 years ago
|
||
(In reply to comment #3)
> vote for compile error
+1
| Assignee | ||
Comment 5•16 years ago
|
||
Hides both the copy constructor and the assignment operator.
Attachment #385722 -
Flags: review?(edwsmith)
| Assignee | ||
Updated•16 years ago
|
Attachment #385722 -
Flags: review?(edwsmith) → review?(stejohns)
Updated•16 years ago
|
Attachment #385722 -
Flags: review?(stejohns) → review+
| Assignee | ||
Comment 6•16 years ago
|
||
redux changeset: 2070:6ad0961dbd41
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•