diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-06-01 12:33:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-01 12:33:13 +0200 |
commit | 8710395a0f7b57bab755ea826a82e3ceef85aa52 (patch) | |
tree | 0ed626d09b93a58dfed8efe39f18c4cc7d156455 /compiler | |
parent | 5d0cf883c15b6bd348ecfe7865cb85ca05e341de (diff) | |
download | Nim-8710395a0f7b57bab755ea826a82e3ceef85aa52.tar.gz |
fixes #14514 [backport:1.2] (#14533)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgcalls.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim index e19e96503..10f5ef638 100644 --- a/compiler/ccgcalls.nim +++ b/compiler/ccgcalls.nim @@ -43,7 +43,9 @@ proc preventNrvo(p: BProc; le, ri: PNode): bool = for i in 1..<ri.len: let r = ri[i] if isPartOf(le, r) != arNo: return true - if canRaiseDisp(p, ri[0]) and + # we use the weaker 'canRaise' here in order to prevent too many + # annoying warnings, see #14514 + if canRaise(ri[0]) and (p.nestedTryStmts.len > 0 or locationEscapes(p, le)): message(p.config, le.info, warnObservableStores, $le) |