Closed
Bug 526970
Opened 16 years ago
Closed 16 years ago
Handle wide string literals in lazy_tree_string
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: philip, Assigned: taras.mozilla)
References
Details
Attachments
(1 file, 2 obsolete files)
|
6.31 KB,
patch
|
philip
:
review+
|
Details | Diff | Splinter Review |
lazy_tree_string calls convert_char_star which calls JS_NewStringCopyZ, for all strings. This fails when it's a wchar_t* string (it only copies the first byte before hitting a null byte and stopping), and makes it impossible to access the string contents from scripts. Strings with non-char precision ought to be converted properly into Unicode JS strings.
| Reporter | ||
Comment 1•16 years ago
|
||
This is a nasty hack - I don't know the right way to implement the feature. But this at least worked for me. Also it fixes handling of non-wide strings with embedded null characters.
| Assignee | ||
Comment 2•16 years ago
|
||
Philip can you attach a testcase with instructions on how to run it?
| Reporter | ||
Comment 3•16 years ago
|
||
A test case (which the patch passes), using the standard Treehydra test runner.
(I'd prefer it if the string was exposed as 't.string.str' or 't.string', rather than 't.string.str_full', but the latter seemed easiest to implement given that I don't quite understand how the code works.)
| Assignee | ||
Comment 4•16 years ago
|
||
nice hack! I think the right thing to do here is some magic. I think
t.string.str should do the unicode conversion that your .str_full hack does. Patch coming right up.
| Assignee | ||
Comment 5•16 years ago
|
||
Thank you for the excellent exploratory patch. It made it really easy to turn into something landable. Please confirm that this works for you and I'll land it.
Attachment #410747 -
Attachment is obsolete: true
Attachment #410819 -
Attachment is obsolete: true
Attachment #410852 -
Flags: review?(philip.taylor)
| Reporter | ||
Comment 6•16 years ago
|
||
Comment on attachment 410852 [details] [diff] [review]
my version
The only problem is I get a compiler error "treehydra.c:223: error: expected ‘)’ before ‘uint16_t’". If I #include <stdint.h> then it looks like it works fine.
Attachment #410852 -
Flags: review?(philip.taylor) → review+
| Assignee | ||
Comment 7•16 years ago
|
||
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Assignee: nobody → tglek
Updated•8 years ago
|
Product: Core → Firefox Build System
Updated•3 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•