From 48d5e4f95cc36f3f2dba1f21b66efad1882d5d27 Mon Sep 17 00:00:00 2001 From: Arne Döring Date: Thu, 21 Mar 2019 06:55:21 +0100 Subject: add condition for szUnknown (#10869) --- compiler/ccgtypes.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 51f04d076..f4864180e 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -246,8 +246,8 @@ proc cacheGetType(tab: TypeCache; sig: SigHash): Rope = result = tab.getOrDefault(sig) proc addAbiCheck(m: BModule, t: PType, name: Rope) = - if isDefined(m.config, "checkabi"): - addf(m.s[cfsTypeInfo], "NIM_CHECK_SIZE($1, $2);$n", [name, rope(getSize(m.config, t))]) + if isDefined(m.config, "checkabi") and (let size = getSize(m.config, t); size != szUnknownSize): + addf(m.s[cfsTypeInfo], "NIM_CHECK_SIZE($1, $2);$n", [name, rope(size)]) proc ccgIntroducedPtr(conf: ConfigRef; s: PSym): bool = var pt = skipTypes(s.typ, typedescInst) -- cgit 1.4.1-2-gfad0