relax icon indicating copy to clipboard operation
relax copied to clipboard

[Refactor][BlockBuilder] Associate BlockBuilder::ExprMemo with the scope to avoid breaking scope rules

Open slyubomirsky opened this issue 2 years ago • 1 comments

This PR fixes the issue noted in #288 in which the BlockBuilder's ExprMemo can store entries between visits, which resulted in violating scoping rules when an expression was visited twice (the first visit populated the memo and the second visit would find the variable in the memo even though the variable was not bound the second time). In #288, the bug was fixed by manually resetting the memo, breaking the visitor's abstraction. By contrast, this PR automatically removes entries from the memo when they go out of scope, not requiring a manual reset.

slyubomirsky avatar Dec 06 '22 03:12 slyubomirsky

LOL, the C++ linter checks for trailing whitespace in comments (which my C++ reformatter does not...). :pensive:

slyubomirsky avatar Dec 06 '22 03:12 slyubomirsky

handled in #308 Thanks to @slyubomirsky bringing up this initial issue

tqchen avatar Dec 13 '22 21:12 tqchen