Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix rtti sizeof for varargs in global scope #13125

Merged
merged 1 commit into from Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/ast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]

Expand Down Expand Up @@ -580,7 +581,6 @@ type
const
routineKinds* = {skProc, skFunc, skMethod, skIterator,
skConverter, skMacro, skTemplate}
tfIncompleteStruct* = tfVarargs
tfUnion* = tfNoSideEffect
tfGcSafe* = tfThread
tfObjHasKids* = tfEnumHasHoles
Expand Down
9 changes: 9 additions & 0 deletions tests/assign/tassign.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
"""

Expand Down Expand Up @@ -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"