Closed Bug 485416 Opened 16 years ago Closed 16 years ago

String::createUTF16 calls checkForTinyString incorrectly

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stejohns, Assigned: daumling)

Details

Attachments

(1 file, 1 obsolete file)

Calling it with a string of length 1 will always return the empty string.
Attached patch Patch (obsolete) — Splinter Review
Note, this call isn't directly accessible to AS3 code (only C++ code).
Attachment #369566 - Flags: review?(daumling)
(I think Michael is on PTO at the moment.) This fix is wrong, see item 2 in https://bugzilla.mozilla.org/show_bug.cgi?id=473995. checkForTinyStrings is careful to construct empty strings of the correct width, this patch undoes that feature.
It's arguably less-wrong than previously, but still, point is taken... better fix will be forthcoming, thanks.
Comment on attachment 369566 [details] [diff] [review] Patch Will add new patch
Attachment #369566 - Flags: review?(daumling) → review-
Two changes throughout all create methods: 1. if the buffer is NULL, set up meaningful values for len, buffer and set staticBuf to true. 2. Removed checkforTinyStrings() and moved the relevant code in reduced form to all creation methods to a point where the desired widht cannot be kAuto anymore, skipping a procedure call with awkward, ugly and buggy code.
Assignee: nobody → daumling
Attachment #369566 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #371033 - Flags: review?(stejohns)
Attachment #371033 - Flags: review?(stejohns) → review+
Pushed as changeset #1693:5d4d1f2ea5e7 (this is my first push - have mercy if I clobbered anything!)
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Resolved fixed engineering / work item that has been pushed. Setting status to verified.
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: