Closed
Bug 1968356
Opened 3 months ago
Closed 2 months ago
Could RootedField avoid aliasing clashes
Categories
(Core :: JavaScript Engine, task, P3)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
141 Branch
Tracking | Status | |
---|---|---|
firefox141 | --- | fixed |
People
(Reporter: mgaudet, Assigned: jonco)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
I think it would be possible in a DEBUG build to add support to RootedField and Tuple for avoiding aliasing. In this model, you'd have a second tuple under the covers of the same dimension as the main tuple, but filled with bool. RootedField would set the bool for its field to true on construction, false on destruction, and assert if the bool is true on construction.
This would avoid accidental misuse via
RootedTuple<Value,Value> roots(cx);
RootedField<Value, 0> v1(roots);
RootedField<Value, 1> v2(roots); // Aliasing
Reporter | ||
Comment 1•3 months ago
|
||
(if we had the ability to check I'd be more willing to use the same field on a tuple twice with non-overlapping ranges)
Reporter | ||
Updated•2 months ago
|
Assignee | ||
Updated•2 months ago
|
Assignee: nobody → jcoppeard
Assignee | ||
Comment 2•2 months ago
|
||
C++ doesn't provide a tuple function to look up the index of a field by its
type so this has to be done with template metaprogramming.
Assignee | ||
Comment 3•2 months ago
|
||
Pushed by jcoppeard@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/ac0f2b4983f0
https://hg.mozilla.org/integration/autoland/rev/53411d13df5e
Add an assertion to check we don't alias rooted fields r=jandem
Status: NEW → RESOLVED
Closed: 2 months ago
status-firefox141:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
Updated•1 month ago
|
QA Whiteboard: [qa-triage-done-c142/b141]
You need to log in
before you can comment on or make changes to this bug.
Description
•