From a6682de0045468ae1d15afbd2fd5378960e15eb7 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 12 Mar 2020 23:44:33 +0100 Subject: catchable defects (#13626) * allow defects to be caught even for --exceptions:goto (WIP) * implemented the new --panics:on|off switch; refs https://github.com/nim-lang/RFCs/issues/180 * new implementation for integer overflow checking * produce a warning if a user-defined exception type inherits from Exception directly * applied Timothee's suggestions; improved the documentation and replace the term 'checked runtime check' by 'panic' * fixes #13627 * don't inherit from Exception directly --- lib/system/gc_common.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/system/gc_common.nim') diff --git a/lib/system/gc_common.nim b/lib/system/gc_common.nim index fe07766d9..ff2b6ad6a 100644 --- a/lib/system/gc_common.nim +++ b/lib/system/gc_common.nim @@ -79,7 +79,7 @@ template decTypeSize(cell, t) = if t.kind in {tyString, tySequence}: let cap = cast[PGenericSeq](cellToUsr(cell)).space let size = if t.kind == tyString: cap+1+GenericSeqSize - else: addInt(mulInt(cap, t.base.size), GenericSeqSize) + else: cap * t.base.size + GenericSeqSize atomicDec t.sizes, size+sizeof(Cell) else: atomicDec t.sizes, t.base.size+sizeof(Cell) -- cgit 1.4.1-2-gfad0