XDR-encode/decode the source text of scripts using codeChars for better typing and to address endianness considerations

RESOLVED FIXED in Firefox 64

Status

()

enhancement
RESOLVED FIXED
8 months ago
8 months ago

People

(Reporter: Waldo, Assigned: Waldo)

Tracking

unspecified
mozilla64
Points:
---

Firefox Tracking Flags

(firefox64 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

8 months ago
No description provided.
Assignee

Comment 1

8 months ago
Posted patch PatchSplinter Review
Attachment #9010503 - Flags: review?(tcampbell)
Comment on attachment 9010503 [details] [diff] [review]
Patch

Review of attachment 9010503 [details] [diff] [review]:
-----------------------------------------------------------------

Much improved, thanks.

::: js/src/vm/JSScript.cpp
@@ +2230,5 @@
>      {
>          size_t match(Uncompressed&) {
> +            // Return 0 so the |if (compressedLength)| tests below correctly
> +            // (and differently) XDR scripts with compressed source and scripts
> +            // with uncompressed source.

// Return 0 for uncompressed source that |if (compressedLength)| tests below can differentiate between compressed and uncompressed sources.

@@ +2277,2 @@
>  
>          uint32_t compressedLength;

// A compressed length of 0 indicates source is uncompressed.
Attachment #9010503 - Flags: review?(tcampbell) → review+

Comment 3

8 months ago
Pushed by jwalden@mit.edu:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cb4aa4bcb7fa
XDR-encode/decode the source text of scripts using codeChars, not codeBytes that can scramble endianness of char16_t source text if the XDR data is read back on a machine of different endianness.  r=tcampbell

Comment 4

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/cb4aa4bcb7fa
Status: ASSIGNED → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.