nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.64k stars 1.47k forks source link

`error: redeclaration of ‘qX60gensym0_’ with no linkage` with nested templates #24338

Closed tersec closed 1 month ago

tersec commented 1 month ago

Description

template c(w: int): int =
  let q = w
  0

template t(r: (int, int); x: int) =
  for _ in r.fields:
    let w = x

proc k() =
  t((0, 0), c(0))

k()

Applies across Cartesian product of

Nim Version

Nim Compiler Version 2.0.10 [Linux: amd64]
Compiled at 2024-10-21
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: e941ee15be775fe3c46db1bed9b4f41c7dfb1334
active boot switches: -d:release
Nim Compiler Version 2.0.11 [Linux: amd64]
Compiled at 2024-10-21
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: e334aad20220ddb5fad63002102d5557464f48c1
active boot switches: -d:release
Nim Compiler Version 2.2.0 [Linux: amd64]
Compiled at 2024-10-21
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 78983f1876726a49c69d65629ab433ea1310ece1
active boot switches: -d:release
Nim Compiler Version 2.2.1 [Linux: amd64]
Compiled at 2024-10-21
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 67442471ae4504bc074c8bb02308613fadc199f8
active boot switches: -d:release

Current Output

/tmp/tmp.Yj3mj2C0HM/@mn.nim.c: In function ‘k__n_u8’:
/tmp/tmp.Yj3mj2C0HM/@mn.nim.c:67:12: error: redeclaration of ‘qX60gensym0_’ with no linkage
   67 |         NI qX60gensym0_;
      |            ^~~~~~~~~~~~
/tmp/tmp.Yj3mj2C0HM/@mn.nim.c:65:12: note: previous declaration of ‘qX60gensym0_’ with type ‘NI’ {aka ‘long int’}
   65 |         NI qX60gensym0_;
      |            ^~~~~~~~~~~~
Error: execution of an external compiler program 'gcc -c  -w -fmax-errors=3 -pthread   -I/tmp/nim/lib -I/tmp -o /tmp/tmp.Yj3mj2C0HM/@mn.nim.c.o /tmp/tmp.Yj3mj2C0HM/@mn.nim.c' failed with exit code: 1

Expected Output

No invalid C codegen

Known Workarounds

No response

Additional Information

No response

ringabout commented 1 month ago

!nim c

template c(w: int): int =
  let q = w
  0

template t(r: (int, int); x: int) =
  for _ in r.fields:
    let w = x

proc k() =
  t((0, 0), c(0))

k()
github-actions[bot] commented 1 month ago
:penguin: Linux bisect by @ringabout (member)
devel :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp #include "nimbase.h" #define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); #define nimln_(n) \ FR_.line = n; #define nimlf_(n, file) \ FR_.line = n; FR_.filename = file; N_LIB_PRIVATE N_NIMCALL(void, k__temp_u8)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4655)(void); static N_INLINE(void, popFrame)(void); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); extern NIM_THREADVAR TFrame* framePtr__system_u2669; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4437; static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u2669 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u2669).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u2669; framePtr__system_u2669 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4655(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u2669 = (*framePtr__system_u2669).prev; } N_LIB_PRIVATE N_NIMCALL(void, k__temp_u8)(void) { NI wX60gensym1_; NI qX60gensym0_; NI wX60gensym1__2; NI qX60gensym0_; nimfr_("k", "/home/runner/work/Nim/Nim/temp.nim"); qX60gensym0_ = ((NI)0); wX60gensym1_ = ((NI)0); qX60gensym0_ = ((NI)0); wX60gensym1__2 = ((NI)0); popFrame(); } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (&nimInErrorMode__system_u4437); return result; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); k__temp_u8(); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2024-10-22T01:51:57
  • Finished 2024-10-22T01:51:57
  • Duration

AST

```nim nnkStmtList.newTree( nnkTemplateDef.newTree( newIdentNode("c"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newIdentNode("int"), nnkIdentDefs.newTree( newIdentNode("w"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("q"), newEmptyNode(), newIdentNode("w") ) ), newLit(0) ) ), nnkTemplateDef.newTree( newIdentNode("t"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("r"), nnkTupleConstr.newTree( newIdentNode("int"), newIdentNode("int") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkForStmt.newTree( newIdentNode("_"), nnkDotExpr.newTree( newIdentNode("r"), newIdentNode("fields") ), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("w"), newEmptyNode(), newIdentNode("x") ) ) ) ) ) ), nnkProcDef.newTree( newIdentNode("k"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode() ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCall.newTree( newIdentNode("t"), nnkTupleConstr.newTree( newLit(0), newLit(0) ), nnkCall.newTree( newIdentNode("c"), newLit(0) ) ) ) ), nnkCall.newTree( newIdentNode("k") ) ) ```
stable :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp #include "nimbase.h" #define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); #define nimln_(n) \ FR_.line = n; #define nimlf_(n, file) \ FR_.line = n; FR_.filename = file; N_LIB_PRIVATE N_NIMCALL(void, k__temp_u8)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4655)(void); static N_INLINE(void, popFrame)(void); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot2dot0atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); extern NIM_THREADVAR TFrame* framePtr__system_u2669; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4437; static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u2669 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u2669).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u2669; framePtr__system_u2669 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4655(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u2669 = (*framePtr__system_u2669).prev; } N_LIB_PRIVATE N_NIMCALL(void, k__temp_u8)(void) { NI wX60gensym1_; NI qX60gensym0_; NI wX60gensym1__2; NI qX60gensym0_; nimfr_("k", "/home/runner/work/Nim/Nim/temp.nim"); qX60gensym0_ = ((NI)0); wX60gensym1_ = ((NI)0); qX60gensym0_ = ((NI)0); wX60gensym1__2 = ((NI)0); popFrame(); } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (&nimInErrorMode__system_u4437); return result; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot2dot0atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot2dot0atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); k__temp_u8(); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2024-10-22T01:52:02
  • Finished 2024-10-22T01:52:02
  • Duration

AST

```nim nnkStmtList.newTree( nnkTemplateDef.newTree( newIdentNode("c"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newIdentNode("int"), nnkIdentDefs.newTree( newIdentNode("w"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("q"), newEmptyNode(), newIdentNode("w") ) ), newLit(0) ) ), nnkTemplateDef.newTree( newIdentNode("t"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("r"), nnkTupleConstr.newTree( newIdentNode("int"), newIdentNode("int") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkForStmt.newTree( newIdentNode("_"), nnkDotExpr.newTree( newIdentNode("r"), newIdentNode("fields") ), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("w"), newEmptyNode(), newIdentNode("x") ) ) ) ) ) ), nnkProcDef.newTree( newIdentNode("k"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode() ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCall.newTree( newIdentNode("t"), nnkTupleConstr.newTree( newLit(0), newLit(0) ), nnkCall.newTree( newIdentNode("c"), newLit(0) ) ) ) ), nnkCall.newTree( newIdentNode("k") ) ) ```
2.0.10 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp #include "nimbase.h" #define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); #define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); #define nimln_(n) \ FR_.line = n; #define nimlf_(n, file) \ FR_.line = n; FR_.filename = file; N_LIB_PRIVATE N_NIMCALL(void, k__temp_u8)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4620)(void); static N_INLINE(void, popFrame)(void); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot10atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); extern NIM_THREADVAR TFrame* framePtr__system_u4059; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4402; static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u4059 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u4059).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u4059; framePtr__system_u4059 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4620(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u4059 = (*framePtr__system_u4059).prev; } N_LIB_PRIVATE N_NIMCALL(void, k__temp_u8)(void) { NI wX60gensym1_; NI qX60gensym0_; NI wX60gensym1__2; NI qX60gensym0_; nimfr_("k", "/home/runner/work/Nim/Nim/temp.nim"); qX60gensym0_ = ((NI)0); wX60gensym1_ = ((NI)0); qX60gensym0_ = ((NI)0); wX60gensym1__2 = ((NI)0); popFrame(); } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (&nimInErrorMode__system_u4402); return result; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot10atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot10atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); k__temp_u8(); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2024-10-22T01:52:06
  • Finished 2024-10-22T01:52:06
  • Duration

AST

```nim nnkStmtList.newTree( nnkTemplateDef.newTree( newIdentNode("c"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newIdentNode("int"), nnkIdentDefs.newTree( newIdentNode("w"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("q"), newEmptyNode(), newIdentNode("w") ) ), newLit(0) ) ), nnkTemplateDef.newTree( newIdentNode("t"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("r"), nnkTupleConstr.newTree( newIdentNode("int"), newIdentNode("int") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkForStmt.newTree( newIdentNode("_"), nnkDotExpr.newTree( newIdentNode("r"), newIdentNode("fields") ), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("w"), newEmptyNode(), newIdentNode("x") ) ) ) ) ) ), nnkProcDef.newTree( newIdentNode("k"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode() ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCall.newTree( newIdentNode("t"), nnkTupleConstr.newTree( newLit(0), newLit(0) ), nnkCall.newTree( newIdentNode("c"), newLit(0) ) ) ) ), nnkCall.newTree( newIdentNode("k") ) ) ```
2.0.0 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp #include "nimbase.h" #define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); #define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); #define nimln_(n) \ FR_.line = n; #define nimlf_(n, file) \ FR_.line = n; FR_.filename = file; N_LIB_PRIVATE N_NIMCALL(void, k__temp_u8)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4607)(void); static N_INLINE(void, popFrame)(void); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); extern NIM_THREADVAR TFrame* framePtr__system_u4006; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4389; static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u4006 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u4006).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u4006; framePtr__system_u4006 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4607(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u4006 = (*framePtr__system_u4006).prev; } N_LIB_PRIVATE N_NIMCALL(void, k__temp_u8)(void) { NI wX60gensym1_; NI qX60gensym0_; NI wX60gensym1__2; NI qX60gensym0_; nimfr_("k", "/home/runner/work/Nim/Nim/temp.nim"); qX60gensym0_ = ((NI)0); wX60gensym1_ = ((NI)0); qX60gensym0_ = ((NI)0); wX60gensym1__2 = ((NI)0); popFrame(); } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (NIM_BOOL*)0; result = (&nimInErrorMode__system_u4389); return result; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); k__temp_u8(); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2024-10-22T01:52:10
  • Finished 2024-10-22T01:52:10
  • Duration

AST

```nim nnkStmtList.newTree( nnkTemplateDef.newTree( newIdentNode("c"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newIdentNode("int"), nnkIdentDefs.newTree( newIdentNode("w"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("q"), newEmptyNode(), newIdentNode("w") ) ), newLit(0) ) ), nnkTemplateDef.newTree( newIdentNode("t"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("r"), nnkTupleConstr.newTree( newIdentNode("int"), newIdentNode("int") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkForStmt.newTree( newIdentNode("_"), nnkDotExpr.newTree( newIdentNode("r"), newIdentNode("fields") ), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("w"), newEmptyNode(), newIdentNode("x") ) ) ) ) ) ), nnkProcDef.newTree( newIdentNode("k"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode() ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCall.newTree( newIdentNode("t"), nnkTupleConstr.newTree( newLit(0), newLit(0) ), nnkCall.newTree( newIdentNode("c"), newLit(0) ) ) ) ), nnkCall.newTree( newIdentNode("k") ) ) ```
1.6.20 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp #include "nimbase.h" # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; N_LIB_PRIVATE N_NIMCALL(void, k__temp_u8)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u2997)(void); static N_INLINE(void, popFrame)(void); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); extern TFrame* framePtr__system_u2564; static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__system_u2564 == ((TFrame*) NIM_NIL))) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__system_u2564).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__system_u2564; framePtr__system_u2564 = s; { if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; callDepthLimitReached__system_u2997(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u2564 = (*framePtr__system_u2564).prev; } N_LIB_PRIVATE N_NIMCALL(void, k__temp_u8)(void) { NI wX60gensym1_; NI qX60gensym0_; NI wX60gensym1__2; NI qX60gensym0_; nimfr_("k", "/home/runner/work/Nim/Nim/temp.nim"); qX60gensym0_ = ((NI) 0); wX60gensym1_ = ((NI) 0); qX60gensym0_ = ((NI) 0); wX60gensym1__2 = ((NI) 0); popFrame(); } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000(); initStackBottomWith((void *)&inner); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); k__temp_u8(); popFrame(); } } ```

Stats

  • Started 2024-10-22T01:52:14
  • Finished 2024-10-22T01:52:14
  • Duration

AST

```nim nnkStmtList.newTree( nnkTemplateDef.newTree( newIdentNode("c"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newIdentNode("int"), nnkIdentDefs.newTree( newIdentNode("w"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("q"), newEmptyNode(), newIdentNode("w") ) ), newLit(0) ) ), nnkTemplateDef.newTree( newIdentNode("t"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("r"), nnkTupleConstr.newTree( newIdentNode("int"), newIdentNode("int") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkForStmt.newTree( newIdentNode("_"), nnkDotExpr.newTree( newIdentNode("r"), newIdentNode("fields") ), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("w"), newEmptyNode(), newIdentNode("x") ) ) ) ) ) ), nnkProcDef.newTree( newIdentNode("k"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode() ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCall.newTree( newIdentNode("t"), nnkTupleConstr.newTree( newLit(0), newLit(0) ), nnkCall.newTree( newIdentNode("c"), newLit(0) ) ) ) ), nnkCall.newTree( newIdentNode("k") ) ) ```
1.4.8 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp #include "nimbase.h" # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; N_LIB_PRIVATE N_NIMCALL(void, k__EzBZaa239as9bFx8yeHDoTOw)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == ((TFrame*) NIM_NIL))) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } N_LIB_PRIVATE N_NIMCALL(void, k__EzBZaa239as9bFx8yeHDoTOw)(void) { NI wX60gensym1_; NI qX60gensym0_; NI wX60gensym1__2; NI qX60gensym0_; nimfr_("k", "/home/runner/work/Nim/Nim/temp.nim"); qX60gensym0_ = ((NI) 0); wX60gensym1_ = ((NI) 0); qX60gensym0_ = ((NI) 0); wX60gensym1__2 = ((NI) 0); popFrame(); } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); k__EzBZaa239as9bFx8yeHDoTOw(); popFrame(); } } ```

Stats

  • Started 2024-10-22T01:52:17
  • Finished 2024-10-22T01:52:17
  • Duration

AST

```nim nnkStmtList.newTree( nnkTemplateDef.newTree( newIdentNode("c"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newIdentNode("int"), nnkIdentDefs.newTree( newIdentNode("w"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("q"), newEmptyNode(), newIdentNode("w") ) ), newLit(0) ) ), nnkTemplateDef.newTree( newIdentNode("t"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("r"), nnkPar.newTree( newIdentNode("int"), newIdentNode("int") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkForStmt.newTree( newIdentNode("_"), nnkDotExpr.newTree( newIdentNode("r"), newIdentNode("fields") ), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("w"), newEmptyNode(), newIdentNode("x") ) ) ) ) ) ), nnkProcDef.newTree( newIdentNode("k"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode() ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCall.newTree( newIdentNode("t"), nnkPar.newTree( newLit(0), newLit(0) ), nnkCall.newTree( newIdentNode("c"), newLit(0) ) ) ) ), nnkCall.newTree( newIdentNode("k") ) ) ```
1.2.18 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp #include "nimbase.h" # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; N_LIB_PRIVATE N_NIMCALL(void, k__EzBZaa239as9bFx8yeHDoTOw)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA8_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } N_LIB_PRIVATE N_NIMCALL(void, k__EzBZaa239as9bFx8yeHDoTOw)(void) { NI wX60gensym3390004_; NI qX60gensym3387020_; NI wX60gensym3390004__2; NI qX60gensym3387020_; nimfr_("k", "/home/runner/work/Nim/Nim/temp.nim"); qX60gensym3387020_ = ((NI) 0); wX60gensym3390004_ = ((NI) 0); qX60gensym3387020_ = ((NI) 0); wX60gensym3390004__2 = ((NI) 0); popFrame(); } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); k__EzBZaa239as9bFx8yeHDoTOw(); popFrame(); } } ```

Stats

  • Started 2024-10-22T01:52:20
  • Finished 2024-10-22T01:52:21
  • Duration

AST

```nim nnkStmtList.newTree( nnkTemplateDef.newTree( newIdentNode("c"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newIdentNode("int"), nnkIdentDefs.newTree( newIdentNode("w"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("q"), newEmptyNode(), newIdentNode("w") ) ), newLit(0) ) ), nnkTemplateDef.newTree( newIdentNode("t"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("r"), nnkPar.newTree( newIdentNode("int"), newIdentNode("int") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkForStmt.newTree( newIdentNode("_"), nnkDotExpr.newTree( newIdentNode("r"), newIdentNode("fields") ), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("w"), newEmptyNode(), newIdentNode("x") ) ) ) ) ) ), nnkProcDef.newTree( newIdentNode("k"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode() ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCall.newTree( newIdentNode("t"), nnkPar.newTree( newLit(0), newLit(0) ), nnkCall.newTree( newIdentNode("c"), newLit(0) ) ) ) ), nnkCall.newTree( newIdentNode("k") ) ) ```
1.0.10 :-1: FAIL

Output

``` ```

IR

Compiled filesize 0 (0 bytes) ```cpp #include "nimbase.h" # define nimfr_(proc, file) \ TFrame FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_); # define nimfrs_(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \ FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_); # define nimln_(n, file) \ FR_.line = n; FR_.filename = file; N_LIB_PRIVATE N_NIMCALL(void, k__EzBZaa239as9bFx8yeHDoTOw)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); static N_INLINE(void, initStackBottomWith)(void* locals); N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; static N_INLINE(void, nimFrame)(TFrame* s) { NI T1_; T1_ = (NI)0; { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA4_; T1_ = ((NI) 0); } goto LA2_; LA4_: ; { T1_ = ((NI) ((NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)))); } LA2_: ; (*s).calldepth = ((NI16) (T1_)); (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA9_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA9_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } N_LIB_PRIVATE N_NIMCALL(void, k__EzBZaa239as9bFx8yeHDoTOw)(void) { NI wX60gensym133024_; NI qX60gensym133020_; NI wX60gensym133024__2; NI qX60gensym133020_; nimfr_("k", "/home/runner/work/Nim/Nim/temp.nim"); qX60gensym133020_ = ((NI) 0); wX60gensym133024_ = ((NI) 0); qX60gensym133020_ = ((NI) 0); wX60gensym133024__2 = ((NI) 0); popFrame(); } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } void PreMainInner(void) { } int cmdCount; char** cmdLine; char** gEnv; void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); k__EzBZaa239as9bFx8yeHDoTOw(); popFrame(); } } ```

Stats

  • Started 2024-10-22T01:52:23
  • Finished 2024-10-22T01:52:24
  • Duration

AST

```nim nnkStmtList.newTree( nnkTemplateDef.newTree( newIdentNode("c"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newIdentNode("int"), nnkIdentDefs.newTree( newIdentNode("w"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("q"), newEmptyNode(), newIdentNode("w") ) ), newLit(0) ) ), nnkTemplateDef.newTree( newIdentNode("t"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("r"), nnkPar.newTree( newIdentNode("int"), newIdentNode("int") ), newEmptyNode() ), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("int"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkForStmt.newTree( newIdentNode("_"), nnkDotExpr.newTree( newIdentNode("r"), newIdentNode("fields") ), nnkStmtList.newTree( nnkLetSection.newTree( nnkIdentDefs.newTree( newIdentNode("w"), newEmptyNode(), newIdentNode("x") ) ) ) ) ) ), nnkProcDef.newTree( newIdentNode("k"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode() ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCall.newTree( newIdentNode("t"), nnkPar.newTree( newLit(0), newLit(0) ), nnkCall.newTree( newIdentNode("c"), newLit(0) ) ) ) ), nnkCall.newTree( newIdentNode("k") ) ) ```
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 20.4
  • Created 2024-10-22T01:51:28Z
  • Comments 1
  • Commands nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim

:robot: Bug found in 30 mins bisecting 8 commits at 0 commits per second

ringabout commented 1 month ago

related to https://github.com/nim-lang/Nim/issues/24023 https://github.com/nim-lang/Nim/issues/15637

metagn commented 1 month ago

Workaround is wrapping the body in block:, I think the fix is to just do this in the compiler with if true so it doesn't break break