Closed
Bug 55143
Opened 24 years ago
Closed 24 years ago
nsPromiseFlat[C]String(Substring(...)) broken
Categories
(Core :: XPCOM, defect, P3)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla0.9
People
(Reporter: waterson, Assigned: scc)
References
Details
You cannot create a correct nsPromiseFlatString on a Substring. Specifically,
nsPromiseFlatString does not detect the case where the Substring does not end at
the right-most character of the "parent" string. Here's a simple example:
const nsAReadableCString& hereIsSomeText
= NS_LITERAL_CSTRING("here is some text");
const nsAReadableCString& some
= Substring(hereIsSomeText, 8, 4);
printf("%s\n", nsPromiseFlatCString(some).get());
Expected output:
some
Actual output:
some text
Reporter | ||
Comment 1•24 years ago
|
||
cc'ing vidur, who worked on nsPromiseFlatString...
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Comment 2•24 years ago
|
||
Need this for RTM?
/be
Assignee | ||
Comment 3•24 years ago
|
||
promise-flat needs some work ... needs to know about non-zero terminated cases, etc.
Target Milestone: --- → mozilla0.9
Assignee | ||
Updated•24 years ago
|
Component: XPCOM → String
Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9 → mozilla0.8.1
Assignee | ||
Comment 4•24 years ago
|
||
(mass change) didn't get these in for target milestone mozilla0.8.1 but they are
very close. Moving all to mozilla0.9.
Target Milestone: mozilla0.8.1 → mozilla0.9
Reporter | ||
Comment 5•24 years ago
|
||
Hey scc, when are you going to fix this?
Assignee | ||
Comment 6•24 years ago
|
||
So this is fixed at the cost of always copying substrings even when that is
_not_ required. I'm going to do more work on substrings to prevent this.
Basically, they have to advertise themselves as flat at the appropriate time.
Currently, they never do. Marking this bug fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•4 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•