diff options
author | Jasper Jenkins <jasper.vs.jenkins@gmail.com> | 2020-01-13 01:17:22 -0800 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2020-01-13 10:17:21 +0100 |
commit | bf2e052e6d97c1117603480547804dd98d1ada71 (patch) | |
tree | 2828cebbbdcf3b935062945ce9a57e445f06b0cf | |
parent | 1f27a2f8ab696bbbfcf4d8f0bf2748dfc1cc86ad (diff) | |
download | Nim-bf2e052e6d97c1117603480547804dd98d1ada71.tar.gz |
fix rtti sizeof for varargs in global scope (#13125) [backport]
-rw-r--r-- | compiler/ast.nim | 4 | ||||
-rw-r--r-- | tests/assign/tassign.nim | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index 3b9726a13..99733ef3f 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -479,7 +479,7 @@ type nfExecuteOnReload # A top-level statement that will be executed during reloads TNodeFlags* = set[TNodeFlag] - TTypeFlag* = enum # keep below 32 for efficiency reasons (now: ~39) + TTypeFlag* = enum # keep below 32 for efficiency reasons (now: ~40) tfVarargs, # procedure has C styled varargs # tyArray type represeting a varargs list tfNoSideEffect, # procedure type does not allow side effects @@ -539,6 +539,7 @@ type tfCheckedForDestructor # type was checked for having a destructor. # If it has one, t.destructor is not nil. tfAcyclic # object type was annotated as .acyclic + tfIncompleteStruct # treat this type as if it had sizeof(pointer) TTypeFlags* = set[TTypeFlag] @@ -580,7 +581,6 @@ type const routineKinds* = {skProc, skFunc, skMethod, skIterator, skConverter, skMacro, skTemplate} - tfIncompleteStruct* = tfVarargs tfUnion* = tfNoSideEffect tfGcSafe* = tfThread tfObjHasKids* = tfEnumHasHoles diff --git a/tests/assign/tassign.nim b/tests/assign/tassign.nim index b421802ae..0589b0214 100644 --- a/tests/assign/tassign.nim +++ b/tests/assign/tassign.nim @@ -5,6 +5,7 @@ TEMP=C:\Programs\xyz\bin 8 5 0 0 pre test a:test b:1 c:2 haha:3 assignment test a:test b:1 c:2 haha:3 +abc123 ''' """ @@ -207,3 +208,11 @@ when false: var a, b: Foo a = b + +block tgeneric_assign_varargs: + template fatal(msgs: varargs[string]) = + for msg in msgs: + stdout.write(msg) + stdout.write('\n') + + fatal "abc", "123" |