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

No exit from loop #2

Open
stepan-mitkin opened this issue Apr 5, 2020 · 2 comments
Open

No exit from loop #2

stepan-mitkin opened this issue Apr 5, 2020 · 2 comments
Labels
bug Something isn't working generator Code generator js JavaScript code generation

Comments

@stepan-mitkin
Copy link
Owner

stepan-mitkin commented Apr 5, 2020

Converging Case branches above a foreach loop cause an infinite loop

@stepan-mitkin
Copy link
Owner Author

20200405075618

This results in

function noExitFromLoop(one, two, three) {
    var _7_col, _7_it, _7_length, _sw_17, item;
    _sw_17 = one;
    if (_sw_17 === "update") {
        _7_it = 0;
        _7_col = three;
        _7_length = _7_col.length;
        while (true) {
            if (_7_it < _7_length) {
                item = _7_col[_7_it];
                _7_it++;
            } else {
                break;
            }
        }
    } else {
        if (_sw_17 === "delete") {
            one = "foo"
            _7_it = 0;
            _7_col = three;
            _7_length = _7_col.length;
            // Infinite loop!
            while (true) {
                if (_7_it < _7_length) {
                    item = _7_col[_7_it];
                    _7_it++;
                }
            }
        } else {
        }
    }
}

@stepan-mitkin stepan-mitkin added bug Something isn't working generator Code generator js JavaScript code generation labels Apr 5, 2020
@stepan-mitkin
Copy link
Owner Author

20200412182431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working generator Code generator js JavaScript code generation
Projects
None yet
Development

No branches or pull requests

1 participant