Skip to content

[Decompiler Bug ?] Incorrect return type #17183

@junxzm1990

Description

@junxzm1990

The decompiler decompiles the following code (ref: decompiler test case control-flow-recovery/noexit_loops.move)

    struct R {}

    fun f4(): R {
        loop {}
    }

===>

struct R {
 }
 fun f4(): R {
    loop continue
  }

The original code compiles, but the decompiled one does not.

Note: this may not be a decompiler bug. The file-format bytecode of the original code is:

f4(): R /* def_idx: 0 */ {
    B0:
	    0: Branch(0)
    }
}

and the decompiled code seems to well respect it.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions