Skip to content
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

Bug fix for #331 continue skips while condition check #332

Merged
merged 4 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyteal/ast/while_.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __teal__(self, options: "CompileOptions"):
block.setNextBlock(end)

for block in continueBlocks:
block.setNextBlock(doStart)
block.setNextBlock(condStart)

return condStart, end

Expand Down
12 changes: 5 additions & 7 deletions pyteal/compiler/compiler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,11 +652,10 @@ def test_compile_continue():
int 3
<
bz main_l4
main_l2:
load 0
int 2
==
bnz main_l2
bnz main_l1
load 0
int 1
+
Expand Down Expand Up @@ -744,11 +743,11 @@ def test_compile_continue_break_nested():
expected = """#pragma version 4
int 0
store 0
main_l1:
load 0
int 10
<
bz main_l2
main_l1:
bz main_l3
load 0
int 1
+
Expand All @@ -757,7 +756,7 @@ def test_compile_continue_break_nested():
int 4
<
bnz main_l1
main_l2:
main_l3:
int 1
return
""".strip()
Expand Down Expand Up @@ -799,7 +798,6 @@ def test_compile_continue_break_nested():
int 10
<
bz main_l8
main_l2:
load 0
int 8
==
Expand All @@ -813,7 +811,7 @@ def test_compile_continue_break_nested():
load 0
int 5
<
bnz main_l2
bnz main_l1
load 0
int 1
+
Expand Down