-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #14165 #18739 #18791
fix #14165 #18739 #18791
Conversation
@@ -734,7 +734,7 @@ proc transformFor(c: PTransf, n: PNode): PNode = | |||
stmtList.add(newAsgnStmt(c, nkFastAsgn, temp, arg)) | |||
idNodeTablePut(newC.mapping, formal, temp) | |||
|
|||
let body = transformBody(c.graph, c.idgen, iter, true) | |||
let body = transformBody(c.graph, c.idgen, iter, true).copyTree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seem expensive and worse, weird. How come for example that not a fresh set of local variables is required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a regression: b1ff37c
Ref #14165 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before 0.20.0, copyTree is used.Then the optimization may remove it wrongly.
copyTree is introduced in here: 5432b2b#diff-c7b80f51fb685eb22c5b56ee2f320d6c708706f3ae7293478ecd104a2b5b8096
Alternative is here #18812 |
fix the second example of #6269
fixes #14165
fixes #18739