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

compiler: finite for loop compiles into infinite loop #699

Closed
alexvanin opened this issue Feb 28, 2020 · 0 comments · Fixed by #700
Closed

compiler: finite for loop compiles into infinite loop #699

alexvanin opened this issue Feb 28, 2020 · 0 comments · Fixed by #700
Assignees
Labels
bug Something isn't working compiler Go smart contract compiler
Milestone

Comments

@alexvanin
Copy link
Contributor

alexvanin commented Feb 28, 2020

I have a for cycle, that checks two conditions. For some reason this codes leads to infinite loop in current master branch f239760.

package foo
func Main() int {
	count := 0
	offset := 0
	for count < 3 && offset < 50 {
		count++
		offset += 10
	}

	return count 
}

In v0.73.0 this code compiles and works correctly.
If I switch conditions for offset < 50 && count < 3 { it also works correctly on master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler Go smart contract compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants