Closed Bug 473995 Opened 16 years ago Closed 16 years ago

String class's "create" methods violate their contracts in several ways

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: lhansen, Assigned: daumling)

References

Details

(1) The documentation states that buffer may not be NULL. The implementations handle NULL buffers perfectly well. The documentation should be fixed (or, if NULL buffers can't be handled, the code that attempts to handle them should be removed). (2) If an empty string is created the width specifier is ignored, and the standard kEmptyString, which is Latin1, is returned. This but bites applications that need to process a particular width of data and that wish to construct data of that width to avoid extra allocation and copying during a conversion. (I have one such application - the run-time compiler, which consumes utf16 input exclusively and tries to create an utf16 string, but unfortunately has to start with an empty string and therefore gets a narrow variant.)
I'll check out.
Status: NEW → ASSIGNED
Assignee: nobody → daumling
Fixed with a patch to bug 481308.
Depends on: 481308
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.