From 68add55fc941fcf6519a819ccf4024bca7970a64 Mon Sep 17 00:00:00 2001 From: zhuoli Date: Wed, 19 Jan 2022 11:48:11 +0800 Subject: [PATCH] Fix missing jmp in if statement caused by lacking of flowNode Signed-off-by: zhuoli Change-Id: I8075282f9160ec71f5a7e0980115219c3d265749 --- ts2panda/src/compiler.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ts2panda/src/compiler.ts b/ts2panda/src/compiler.ts index 3a33940bd3..7affc7fa79 100644 --- a/ts2panda/src/compiler.ts +++ b/ts2panda/src/compiler.ts @@ -553,12 +553,7 @@ export class Compiler { this.compileCondition(stmt.expression, stmt.elseStatement ? ifElseLabel : ifEndLabel); this.compileStatement(stmt.thenStatement); if (stmt.elseStatement) { - let flowNode = jshelpers.getFlowNode(stmt); - if (flowNode !== undefined) { - if (!(flowNode.flags & ts.FlowFlags.Unreachable)) { // if not unreachable - this.pandaGen.branch(DebugInfo.getLastNode(), ifEndLabel); - } - } + this.pandaGen.branch(DebugInfo.getLastNode(), ifEndLabel); this.pandaGen.label(stmt, ifElseLabel); this.compileStatement(stmt.elseStatement); } -- Gitee