backend: fix handling unreachable return from inlined function

This commit is contained in:
Svyatoslav Scherbina
2017-03-13 15:51:29 +07:00
committed by SvyatoslavScherbina
parent 37b7940544
commit c9e2b5ac69
@@ -1406,10 +1406,11 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid
return return
} }
// It is local return. // It is local return.
codegen.br(getExit()!!) // Generate branch on exit block.
if (KotlinBuiltIns.isUnit(inlineBody.type) == false) { // If function returns more then "unit" if (KotlinBuiltIns.isUnit(inlineBody.type) == false) { // If function returns more then "unit"
codegen.assignPhis(getResult()!! to value!!) // Assign return value to result PHI node. codegen.assignPhis(getResult()!! to value!!) // Assign return value to result PHI node.
} }
codegen.br(getExit()!!) // Generate branch on exit block.
} }
} }