From 13d232ec56c0b9264af5f266f87cc5981bde6c1e Mon Sep 17 00:00:00 2001 From: cooldome Date: Tue, 10 Dec 2019 06:08:46 +0000 Subject: [PATCH] fixes #12827 (#12829) [backport] --- compiler/cgen.nim | 9 +++++---- tests/destructor/tnewruntime_misc.nim | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index a456b7d51..3982f60cc 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -945,11 +945,12 @@ proc allPathsAsgnResult(n: PNode): InitResultEnum = # assignment this is not good enough! The only pattern we allow for # is 'finally: result = x' result = InitSkippable - for it in n: - if it.kind == nkFinally: - result = allPathsAsgnResult(it.lastSon) + allPathsInBranch(n[0]) + for i in 1..