XDRScript should create JSScript with valid constructor arguments

RESOLVED FIXED in Firefox 67

Status

()

enhancement
P2
normal
RESOLVED FIXED
7 months ago
6 months ago

People

(Reporter: tcampbell, Assigned: tcampbell)

Tracking

unspecified
mozilla67
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox67 fixed)

Details

Attachments

(3 attachments)

In Bug 1451284 we have issues with coverage misbehaving that stem from XDR decoding.

We initialize the coverage data structures before the filename is properly set when something is OwnSource. We should code things in the appropriate order so that we can call JSScript::Create with legal values.

[1] https://searchfox.org/mozilla-central/rev/9eb30227b21e0aa40d51d9f9b08bb0b113c5fadb/js/src/vm/JSScript.cpp#520,566

Sanity check was reading out-of-range value. This caused more XDR decode
failures than expected, but non-cache load would recover anyways. With
fix, a few more cases will support XDR caching.

This ensures the script source is properly ininitialized before calling
JSScript::Create. This fixes issues with LCov when the script comes from
an XDR-based cache.

Depends on D18873

There is no existing bug, but passing correct values to constructor is
more predictable for future.

Depends on D18874

Blocks: 1525924
Status: NEW → ASSIGNED

(Changing reviewers based on workload/availability)

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/41ba287d84da
Fix bug in XDRState::codeCString r=jandem,nbp
https://hg.mozilla.org/integration/autoland/rev/c4e1215ffff6
XDR ScriptSource before Script r=jandem
https://hg.mozilla.org/integration/autoland/rev/d6729b60b236
Pass source extents to JSScript constructor in XDRScript r=jandem
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
See Also: → 1528964
Blocks: 1528320
You need to log in before you can comment on or make changes to this bug.