-
Notifications
You must be signed in to change notification settings - Fork 17
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
Block rewriting error when there are no explicit break #76
Comments
Similar bug for if statement: var r = 0
proc b() {.cps: Cont.} =
if true:
noop()
inc r
inc r
trampoline b()
check r == 2, "expected 2, got: " & $r The issue in here is that saften expects control flow continuation to happen after the scoped block: https://github.com/disruptek/cps/blob/0ba9b8bbfa024464caba663399f55897966bea3a/cps.nim#L579-L597 The idea doesn't hold when splitting is performed. |
We have similar behavior in several places and the "solution" we use thus far -- staggered inclusion in the stack -- is a hack that seems unlikely to weather extension. We should probably just enumerate the different modes and add proper support into But we should talk about whether we even want However, it's not obvious: if we switch to stages, we may be moving a lot of the complexity into the type construction. Maybe those artifacts are simply accumulated across passes, I dunno. |
For-loops are inlined using block statements, which messes with their control flow due to nim-works#76. Breaks "for loop with continue, break" test. On the flip side, splitting now functions on them. Also breaks a test in tzevv due to defer being rewritten into try-finally, which doesn't work.
For-loops are inlined using block statements, which messes with their control flow due to nim-works#76. Breaks "for loop with continue, break" test. On the flip side, splitting now functions on them. Also breaks a test in tzevv due to defer being rewritten into try-finally, which doesn't work. Co-authored-by: Andy Davidoff <github@andy.disruptek.com>
For-loops are inlined using block statements, which messes with their control flow due to nim-works#76. Breaks a test in tzevv due to defer being rewritten into try-finally, which doesn't work. Co-authored-by: Andy Davidoff <github@andy.disruptek.com>
Found while messing with "shadow mission impossible"
Output:
The text was updated successfully, but these errors were encountered: