All users were logged out of Bugzilla on October 13th, 2018

Use the standard placeholder-making function when re-scoping variable references in generator 'yield' expressions

RESOLVED FIXED in mozilla8

Status

()

RESOLVED FIXED
8 years ago
7 years ago

People

(Reporter: jimb, Assigned: jimb)

Tracking

unspecified
mozilla8
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

8 years ago
CompExprTransplanter::transplant does a bunch of bespoke pointer-fiddling
to take the free variable references in the 'yield' expression and re-scope
them within the comprehension tail clauses.

Bug 576847 corrected the way this code incorrectly constructed placeholders for function references, but it would also work to simply use the same placeholder construction function everybody else does.
(Assignee)

Comment 1

8 years ago
Created attachment 505940 [details] [diff] [review]
Use the standard placeholder-making function when re-scoping variable references in generator 'yield' expressions. [feedback=brendan in bug 576847]

CompExprTransplanter::transplant did a bunch of bespoke pointer-fiddling to
take the free variable references in the 'yield' expression and re-scope
them within the comprehension tail clauses. That code incorrectly
constructed placeholders for function references; this was fixed in bug 576847.

However, it would also work to simply use the same placeholder construction
function everybody else does. This patch makes it so.
Assignee: general → jimb
(Assignee)

Comment 2

8 years ago
Created attachment 519746 [details] [diff] [review]
Use the standard placeholder-making function when re-scoping variable references in generator 'yield' expressions.

Refreshed and re-tested for current TM.
Attachment #505940 - Attachment is obsolete: true
Attachment #519746 - Flags: review?(brendan)
Comment on attachment 519746 [details] [diff] [review]
Use the standard placeholder-making function when re-scoping variable references in generator 'yield' expressions.

Sorry, thought I r+'ed this already a while ago.

/be
Attachment #519746 - Flags: review?(brendan) → review+
(Assignee)

Comment 4

7 years ago
http://hg.mozilla.org/tracemonkey/rev/756abc094eb1

Adapted to latest sources.

Also, the original patch failed to correctly flatten the nested 'if's, and would move placeholders from outside the comprehension into the comprehension's lexdeps table. Added a test to catch this case, and fixed the problem.
Whiteboard: fixed-in-tracemonkey
Depends on: 668438
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.