Closed
Bug 1466503
Opened 6 years ago
Closed 6 years ago
JSContext::currentScript should probably check same-realm instead of same-compartment
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla62
Tracking | Status | |
---|---|---|
firefox62 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(3 files)
(deleted),
patch
|
tcampbell
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
It has this allowSameCompartment argument that defaults to DONT_ALLOW_CROSS_COMPARTMENT. Looking at (some of) the callers, I think changing this to allowSameRealm is the right thing to do.
Assignee | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
This adds a separate DescribeScriptedCallerForDirectEval function, instead of handling this case in DescribeScriptedCallerForCompilation.
It's a bit simpler and it eliminates a cx->currentScript call for direct evals: the callers already know the JSOP_EVAL script/pc.
Attachment #8985643 -
Flags: review?(luke)
Assignee | ||
Comment 3•6 years ago
|
||
With some minor cleanup.
Attachment #8985646 -
Flags: review?(luke)
Updated•6 years ago
|
Attachment #8985641 -
Flags: review?(tcampbell) → review+
Comment 4•6 years ago
|
||
Comment on attachment 8985643 [details] [diff] [review]
Part 2 - Some DescribeScriptedCallerForCompilation cleanup
Review of attachment 8985643 [details] [diff] [review]:
-----------------------------------------------------------------
Nice!
Attachment #8985643 -
Flags: review?(luke) → review+
Comment 5•6 years ago
|
||
Comment on attachment 8985646 [details] [diff] [review]
Part 3 - Check realms instead of compartments in JSContext::currentScript
Review of attachment 8985646 [details] [diff] [review]:
-----------------------------------------------------------------
Good catch
Attachment #8985646 -
Flags: review?(luke) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0c4e97614565
part 1 - Pass script to GetIntrinsicOperation so it doesn't have to look it up. r=tcampbell
https://hg.mozilla.org/integration/mozilla-inbound/rev/92d154bc6515
part 2 - Some DescribeScriptedCallerForCompilation cleanup. r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/40461ea89e0c
part 3 - Check realms instead of compartments in JSContext::currentScript. r=luke
Comment 7•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0c4e97614565
https://hg.mozilla.org/mozilla-central/rev/92d154bc6515
https://hg.mozilla.org/mozilla-central/rev/40461ea89e0c
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox62:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in
before you can comment on or make changes to this bug.
Description
•