Skip to content

[Decompiler Feature Request] #17054

@junxzm1990

Description

@junxzm1990

🚀 Feature Request

The decompiler decompiles the code below (ref: decompiler test case noexit_loop.move)

    fun baz(_: &u64) {}
    fun f13(cond: bool) {
        1 + if (cond) 0 else { 1 } + 2;
        1 + loop {} + 2;
        1 + return + 0;

        baz(&if (cond) 0 else 1);
        baz(&loop {});
        baz(&return);
        baz(&abort 0);
    }

===>

fun f13(cond: bool) {
        let _t2;
        loop {
            if (cond) {
                _t2 = 0;
                break
            };
            _t2 = 1;
            break
        };
        loop continue
}

The first loop is introduced by control flow structuring. It should be optimized.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions