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.63k stars 1.47k forks source link

Cast seq to string, heap buffer overflow with stdlib assuming terminating '\0' #24011

Open planetis-m opened 3 months ago

planetis-m commented 3 months ago

Description

import std/sequtils

proc foo(x: string) =
  echo x & "abc"

foo(cast[string](repeat('a', 6)))

The error log points to this code:

T3_ = rawNewString(x_p0.len + 3);appendString((&T3_), x_p0);appendString((&T3_)
proc appendString(dest: var NimStringV2; src: NimStringV2) {.compilerproc, inline.} =
  if src.len > 0:
    # also copy the \0 terminator:
    copyMem(unsafeAddr dest.p.data[dest.len], unsafeAddr src.p.data[0], src.len+1)
    inc dest.len, src.len

Nim Version

Nim Compiler Version 2.1.9 [Linux: amd64] Compiled at 2024-08-24 Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 7c59987dbd90ae397cd105e37d9b0661696ef669 active boot switches: -d:release

Current Output

==17157==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x50200000001e at pc 0x557b49ab4776 bp 0x7ffd61f1a6f0 sp 0x7ffd61f19eb0
READ of size 7 at 0x50200000001e thread T0

    #0 0x557b49ab4775 in __asan_memcpy (raydev/raylib-examples/personal/test_sh+0x11b775) (BuildId: 3f333f850346810698a930c911bc300384afb4fc)
    #1 0x557b49b0c2f8 in nimCopyMem Nim/lib/system/memory.nim:10:24
    #2 0x557b49b0c2f8 in system::copyMem(pointer, pointer, range09223372036854775807) Nim/lib/system.nim:2076:2
    #3 0x557b49b0c2f8 in appendString Nim/lib/system/strs_v2.nim:116:355
    #4 0x557b49b0c02a in test_sh::foo(string) raydev/raylib-examples/personal/test_sh.nim:4:230
    #5 0x557b49b0c67f in NimMainModule raydev/raylib-examples/personal/test_sh.nim:6:173
    #6 0x557b49b0c67f in NimMainInner Nim/lib/system.nim:399:2
    #7 0x557b49b0c67f in NimMain Nim/lib/system.nim:410:2
    #8 0x557b49b0c67f in main Nim/lib/system.nim:418:2
    #9 0x7f50b2cc1e07 in __libc_start_call_main /usr/src/debug/glibc/glibc/csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #10 0x7f50b2cc1ecb in __libc_start_main /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:360:3
    #11 0x557b499cc0c4 in _start (raydev/raylib-examples/personal/test_sh+0x330c4) (BuildId: 3f333f850346810698a930c911bc300384afb4fc)

0x50200000001e is located 0 bytes after 14-byte region [0x502000000010,0x50200000001e)
allocated by thread T0 here:
    #0 0x557b49ab81a9 in malloc (raydev/raylib-examples/personal/test_sh+0x11f1a9) (BuildId: 3f333f850346810698a930c911bc300384afb4fc)
    #1 0x557b49b03f16 in newSeqPayloadUninit Nim/lib/system/seqs_v2.nim:55:773

SUMMARY: AddressSanitizer: heap-buffer-overflow (raydev/raylib-examples/personal/test_sh+0x11b775) (BuildId: 3f333f850346810698a930c911bc300384afb4fc) in __asan_memcpy
Shadow bytes around the buggy address:
  0x501ffffffd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x501ffffffe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x501ffffffe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x501fffffff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x501fffffff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x502000000000: fa fa 00[06]fa fa fa fa fa fa fa fa fa fa fa fa
  0x502000000080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x502000000100: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x502000000180: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x502000000200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x502000000280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==17157==ABORTING

Expected Output

No response

Possible Solution

I wouldn't put blame on https://github.com/nim-lang/Nim/pull/24004 as the same bug was possible before but it happened on the =dup(cast[string](x)) call.

Additional Information

nimPNG is affected as it uses string internally.

planetis-m commented 3 months ago

@juancarlospaco Can you also use the flags? -t:"-fsanitize=address" -l:"-fsanitize=address" -d:nosignalhandler

github-actions[bot] commented 3 months ago
:penguin: Linux bisect by @juancarlospaco (collaborator)
devel :+1: OK

Output

``` ```

IR

Compiled filesize 378.27 Kb (387,352 bytes) ```cpp #include "nimbase.h" #include #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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0); static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2); static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN8sequtils6repeatE4char25range09223372036854775807)(NIM_CHAR x_p0, NI n_p1); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3seqI4charE)(tySequence__lBgZ7a89beZGYPl8PiANMTA dest_p0); 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); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3983; extern NIM_THREADVAR TFrame* framePtr__system_u2622; #line 8 FX_36 static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; #line 10 FX_36 T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));} #line 2075 FX_2 static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2) { #line 2076 FX_2 nimCopyMem(dest_p0, source_p1, size_p2); } #line 113 FX_40 static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {{ #line 114 FX_40 { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; if (!(((NI)0) < src_p1.len)) goto LA3_; #line 116 FX_40 if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_; } _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 FX_40 if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 444 FX_47 static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; #line 445 FX_47 result = (&nimInErrorMode__system_u3983); return result;} #line 570 FX_47 static N_INLINE(void, nimFrame)(TFrame* s_p0) { #line 571 FX_47 { if (!(framePtr__system_u2622 == ((TFrame*) NIM_NIL))) goto LA3_; #line 572 FX_47 (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { #line 575 FX_47 (*s_p0).calldepth = (NI16)((*framePtr__system_u2622).calldepth + ((NI16)1)); } LA1_: ; #line 577 FX_47 (*s_p0).prev = framePtr__system_u2622; #line 578 FX_47 framePtr__system_u2622 = s_p0; #line 579 FX_47 { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 118 FX_47 static N_INLINE(void, popFrame)(void) { #line 119 FX_47 framePtr__system_u2622 = (*framePtr__system_u2622).prev;} #line 2 FX_31 N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0) { #line 3 FX_31 NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x_p0.len + 3);appendString((&T3_), x_p0);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 378 FX_2 if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p);} } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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) { #line 999999 "generated_not_to_break_here" { #line 4 FX_31 tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD_ = _ZN8sequtils6repeatE4char25range09223372036854775807(97, ((NI)6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 635 FX_2 _ZN6system10eqdestroy_E3seqI4charE(colontmpD_); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T20:12:11
  • Finished 2024-08-24T20:12:12
  • Duration 1 mins
stable :+1: OK

Output

``` ```

IR

Compiled filesize 374.62 Kb (383,608 bytes) ```cpp #include "nimbase.h" #include #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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0); static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2); static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN8sequtils6repeatE4char25range09223372036854775807)(NIM_CHAR x_p0, NI n_p1); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3seqI4charE)(tySequence__lBgZ7a89beZGYPl8PiANMTA dest_p0); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3975; extern NIM_THREADVAR TFrame* framePtr__system_u3650; #line 8 FX_37 static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; #line 10 FX_37 T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));} #line 2022 FX_2 static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2) { #line 2023 FX_2 nimCopyMem(dest_p0, source_p1, size_p2); } #line 113 FX_41 static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {{ #line 114 FX_41 { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; if (!(((NI)0) < src_p1.len)) goto LA3_; #line 116 FX_41 if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_; } _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 FX_41 if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 440 FX_48 static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; #line 441 FX_48 result = (&nimInErrorMode__system_u3975); return result;} #line 566 FX_48 static N_INLINE(void, nimFrame)(TFrame* s_p0) { #line 567 FX_48 { if (!(framePtr__system_u3650 == ((TFrame*) NIM_NIL))) goto LA3_; #line 568 FX_48 (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { #line 571 FX_48 (*s_p0).calldepth = (NI16)((*framePtr__system_u3650).calldepth + ((NI16)1)); } LA1_: ; #line 573 FX_48 (*s_p0).prev = framePtr__system_u3650; #line 574 FX_48 framePtr__system_u3650 = s_p0; #line 575 FX_48 { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 114 FX_48 static N_INLINE(void, popFrame)(void) { #line 115 FX_48 framePtr__system_u3650 = (*framePtr__system_u3650).prev;} #line 2 FX_31 N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0) { #line 3 FX_31 NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x_p0.len + 3);appendString((&T3_), x_p0);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 372 FX_2 if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p);} } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_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) { #line 999999 "generated_not_to_break_here" { #line 4 FX_31 tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD_ = _ZN8sequtils6repeatE4char25range09223372036854775807(97, ((NI)6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 633 FX_2 _ZN6system10eqdestroy_E3seqI4charE(colontmpD_); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T20:12:15
  • Finished 2024-08-24T20:12:17
  • Duration 1 mins
2.0.8 :+1: OK

Output

``` ```

IR

Compiled filesize 374.62 Kb (383,608 bytes) ```cpp #include "nimbase.h" #include #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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0); static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2); static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN8sequtils6repeatE4char25range09223372036854775807)(NIM_CHAR x_p0, NI n_p1); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3seqI4charE)(tySequence__lBgZ7a89beZGYPl8PiANMTA dest_p0); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3975; extern NIM_THREADVAR TFrame* framePtr__system_u3650; #line 8 FX_37 static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; #line 10 FX_37 T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));} #line 2022 FX_2 static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2) { #line 2023 FX_2 nimCopyMem(dest_p0, source_p1, size_p2); } #line 113 FX_41 static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {{ #line 114 FX_41 { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; if (!(((NI)0) < src_p1.len)) goto LA3_; #line 116 FX_41 if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_; } _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 FX_41 if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 440 FX_48 static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; #line 441 FX_48 result = (&nimInErrorMode__system_u3975); return result;} #line 566 FX_48 static N_INLINE(void, nimFrame)(TFrame* s_p0) { #line 567 FX_48 { if (!(framePtr__system_u3650 == ((TFrame*) NIM_NIL))) goto LA3_; #line 568 FX_48 (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { #line 571 FX_48 (*s_p0).calldepth = (NI16)((*framePtr__system_u3650).calldepth + ((NI16)1)); } LA1_: ; #line 573 FX_48 (*s_p0).prev = framePtr__system_u3650; #line 574 FX_48 framePtr__system_u3650 = s_p0; #line 575 FX_48 { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 114 FX_48 static N_INLINE(void, popFrame)(void) { #line 115 FX_48 framePtr__system_u3650 = (*framePtr__system_u3650).prev;} #line 2 FX_31 N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0) { #line 3 FX_31 NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x_p0.len + 3);appendString((&T3_), x_p0);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 372 FX_2 if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p);} } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_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) { #line 999999 "generated_not_to_break_here" { #line 4 FX_31 tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD_ = _ZN8sequtils6repeatE4char25range09223372036854775807(97, ((NI)6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 633 FX_2 _ZN6system10eqdestroy_E3seqI4charE(colontmpD_); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T20:12:17
  • Finished 2024-08-24T20:12:18
  • Duration 1 mins
2.0.0 :+1: OK

Output

``` ```

IR

Compiled filesize 330.17 Kb (338,096 bytes) ```cpp #include "nimbase.h" #include #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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, foo__temp_u2)(NimStringV2 x_p0); static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1); static N_INLINE(void, copyMem__system_u1745)(void* dest_p0, void* source_p1, NI size_p2); static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4156)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, repeat__temp_u4)(NIM_CHAR x_p0, NI n_p1); N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u122)(tySequence__lBgZ7a89beZGYPl8PiANMTA dest_p0); 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); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3964; extern NIM_THREADVAR TFrame* framePtr__system_u3602; #line 8 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/memory.nim" static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; #line 10 T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));} #line 2016 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim" static N_INLINE(void, copyMem__system_u1745)(void* dest_p0, void* source_p1, NI size_p2) { #line 2017 nimCopyMem(dest_p0, source_p1, size_p2); } #line 94 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/strs_v2.nim" static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {{ #line 95 { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; if (!(((NI)0) < src_p1.len)) goto LA3_; #line 97 if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_; } copyMem__system_u1745(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 98 if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 423 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/excpt.nim" static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (NIM_BOOL*)0; #line 424 result = (&nimInErrorMode__system_u3964); return result;} #line 549 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/excpt.nim" static N_INLINE(void, nimFrame)(TFrame* s_p0) { #line 550 { if (!(framePtr__system_u3602 == ((TFrame*) NIM_NIL))) goto LA3_; #line 551 (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { #line 554 (*s_p0).calldepth = (NI16)((*framePtr__system_u3602).calldepth + ((NI16)1)); } LA1_: ; #line 556 (*s_p0).prev = framePtr__system_u3602; #line 557 framePtr__system_u3602 = s_p0; #line 558 { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4156(); } LA8_: ; } #line 99 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/excpt.nim" static N_INLINE(void, popFrame)(void) { #line 100 framePtr__system_u3602 = (*framePtr__system_u3602).prev;} #line 2 "/home/runner/work/Nim/Nim/temp.nim" N_LIB_PRIVATE N_NIMCALL(void, foo__temp_u2)(NimStringV2 x_p0) { #line 3 NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x_p0.len + 3);appendString((&T3_), x_p0);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 370 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim" if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p);} } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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) { #line 999999 "generated_not_to_break_here" { #line 4 "/home/runner/work/Nim/Nim/temp.nim" tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD_ = repeat__temp_u4(97, ((NI)6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; foo__temp_u2((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 635 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim" eqdestroy___temp_u122(colontmpD_); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T20:12:20
  • Finished 2024-08-24T20:12:22
  • Duration 1 mins
1.6.20 :+1: OK

Output

``` ```

IR

Compiled filesize 333.49 Kb (341,496 bytes) ```cpp #include "nimbase.h" #include # 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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload {NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 {NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x); static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3varI6stringE)(NimStringV2* dest); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN6repeat6repeatE4char25range09223372036854775807)(NIM_CHAR x, NI n); N_LIB_PRIVATE N_NIMCALL(void, _ZN6newSeq10eqdestroy_E3varI3seqI4charEE)(tySequence__lBgZ7a89beZGYPl8PiANMTA* dest); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); 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); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_BOOL nimInErrorMode__system_u3906; extern TFrame* framePtr__system_u3581; #line 8 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size)));} #line 2230 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size) { #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" nimCopyMem(dest, source, size); } #line 113 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src) {{ #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (!(((NI) 0) < src.len)) goto LA3_; #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt(src.len, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;}; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI) 0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI) 0), ((NI) IL64(9223372036854775807))); goto BeforeRet_;} #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest).p).data[(*dest).len]))), ((void*) ((&(*src.p).data[((NI) 0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt((*dest).len, src.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_;}; (*dest).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" NIM_BOOL* result; result = (NIM_BOOL*)0; #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" result = (&nimInErrorMode__system_u3906); return result;} #line 549 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, nimFrame)(TFrame* s) { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!(framePtr__system_u3581 == ((TFrame*) NIM_NIL))) goto LA3_; #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = (NI16)((*framePtr__system_u3581).calldepth + ((NI16) 1)); } LA1_: ; #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).prev = framePtr__system_u3581; #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3581 = s; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 99 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, popFrame)(void) { #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3581 = (*framePtr__system_u3581).prev;} #line 2 "/home/runner/work/Nim/Nim/temp.nim" N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x) { #line 3 "/home/runner/work/Nim/Nim/temp.nim" NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x.len + 3);appendString((&T3_), x);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" _ZN6system10eqdestroy_E3varI6stringE((&colontmpD_)); } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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) { atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000(); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000(); PreMainInner(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { PreMain(); NimMainInner(); } 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) { #line 999999 "generated_not_to_break_here" { #line 4 "/home/runner/work/Nim/Nim/temp.nim" tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" colontmpD_ = _ZN6repeat6repeatE4char25range09223372036854775807(97, ((NI) 6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 4 "/home/runner/work/Nim/Nim/temp.nim" _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" _ZN6newSeq10eqdestroy_E3varI3seqI4charEE((&colontmpD_)); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T20:12:24
  • Finished 2024-08-24T20:12:25
  • Duration 1 mins
1.4.8 :-1: FAIL

Output

``` ```

IR

Compiled filesize 333.49 Kb (341,496 bytes) ```cpp #include "nimbase.h" #include # 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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload {NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 {NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x); static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3varI6stringE)(NimStringV2* dest); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN6repeat6repeatE4char25range09223372036854775807)(NIM_CHAR x, NI n); N_LIB_PRIVATE N_NIMCALL(void, _ZN6newSeq10eqdestroy_E3varI3seqI4charEE)(tySequence__lBgZ7a89beZGYPl8PiANMTA* dest); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); 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); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_BOOL nimInErrorMode__system_u3906; extern TFrame* framePtr__system_u3581; #line 8 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size)));} #line 2230 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size) { #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" nimCopyMem(dest, source, size); } #line 113 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src) {{ #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (!(((NI) 0) < src.len)) goto LA3_; #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt(src.len, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;}; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI) 0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI) 0), ((NI) IL64(9223372036854775807))); goto BeforeRet_;} #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest).p).data[(*dest).len]))), ((void*) ((&(*src.p).data[((NI) 0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt((*dest).len, src.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_;}; (*dest).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" NIM_BOOL* result; result = (NIM_BOOL*)0; #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" result = (&nimInErrorMode__system_u3906); return result;} #line 549 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, nimFrame)(TFrame* s) { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!(framePtr__system_u3581 == ((TFrame*) NIM_NIL))) goto LA3_; #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = (NI16)((*framePtr__system_u3581).calldepth + ((NI16) 1)); } LA1_: ; #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).prev = framePtr__system_u3581; #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3581 = s; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 99 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, popFrame)(void) { #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3581 = (*framePtr__system_u3581).prev;} #line 2 "/home/runner/work/Nim/Nim/temp.nim" N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x) { #line 3 "/home/runner/work/Nim/Nim/temp.nim" NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x.len + 3);appendString((&T3_), x);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" _ZN6system10eqdestroy_E3varI6stringE((&colontmpD_)); } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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) { atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000(); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000(); PreMainInner(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { PreMain(); NimMainInner(); } 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) { #line 999999 "generated_not_to_break_here" { #line 4 "/home/runner/work/Nim/Nim/temp.nim" tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" colontmpD_ = _ZN6repeat6repeatE4char25range09223372036854775807(97, ((NI) 6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 4 "/home/runner/work/Nim/Nim/temp.nim" _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" _ZN6newSeq10eqdestroy_E3varI3seqI4charEE((&colontmpD_)); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T20:12:27
  • Finished 2024-08-24T20:12:27
  • Duration

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( nnkInfix.newTree( newIdentNode("/"), newIdentNode("std"), newIdentNode("sequtils") ) ), nnkProcDef.newTree( newIdentNode("foo"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("string"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCommand.newTree( newIdentNode("echo"), nnkInfix.newTree( newIdentNode("&"), newIdentNode("x"), newLit("abc") ) ) ) ), nnkCall.newTree( newIdentNode("foo"), nnkCast.newTree( newIdentNode("string"), nnkCall.newTree( newIdentNode("repeat"), newLit('a'), newLit(6) ) ) ) ) ```
1.2.18 :-1: FAIL

Output

``` ```

IR

Compiled filesize 333.49 Kb (341,496 bytes) ```cpp #include "nimbase.h" #include # 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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload {NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 {NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x); static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3varI6stringE)(NimStringV2* dest); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN6repeat6repeatE4char25range09223372036854775807)(NIM_CHAR x, NI n); N_LIB_PRIVATE N_NIMCALL(void, _ZN6newSeq10eqdestroy_E3varI3seqI4charEE)(tySequence__lBgZ7a89beZGYPl8PiANMTA* dest); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); 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); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_BOOL nimInErrorMode__system_u3906; extern TFrame* framePtr__system_u3581; #line 8 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size)));} #line 2230 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size) { #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" nimCopyMem(dest, source, size); } #line 113 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src) {{ #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (!(((NI) 0) < src.len)) goto LA3_; #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt(src.len, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;}; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI) 0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI) 0), ((NI) IL64(9223372036854775807))); goto BeforeRet_;} #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest).p).data[(*dest).len]))), ((void*) ((&(*src.p).data[((NI) 0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt((*dest).len, src.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_;}; (*dest).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" NIM_BOOL* result; result = (NIM_BOOL*)0; #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" result = (&nimInErrorMode__system_u3906); return result;} #line 549 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, nimFrame)(TFrame* s) { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!(framePtr__system_u3581 == ((TFrame*) NIM_NIL))) goto LA3_; #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = (NI16)((*framePtr__system_u3581).calldepth + ((NI16) 1)); } LA1_: ; #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).prev = framePtr__system_u3581; #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3581 = s; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 99 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, popFrame)(void) { #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3581 = (*framePtr__system_u3581).prev;} #line 2 "/home/runner/work/Nim/Nim/temp.nim" N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x) { #line 3 "/home/runner/work/Nim/Nim/temp.nim" NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x.len + 3);appendString((&T3_), x);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" _ZN6system10eqdestroy_E3varI6stringE((&colontmpD_)); } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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) { atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000(); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000(); PreMainInner(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { PreMain(); NimMainInner(); } 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) { #line 999999 "generated_not_to_break_here" { #line 4 "/home/runner/work/Nim/Nim/temp.nim" tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" colontmpD_ = _ZN6repeat6repeatE4char25range09223372036854775807(97, ((NI) 6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 4 "/home/runner/work/Nim/Nim/temp.nim" _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" _ZN6newSeq10eqdestroy_E3varI3seqI4charEE((&colontmpD_)); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T20:12:29
  • Finished 2024-08-24T20:12:29
  • Duration

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( nnkInfix.newTree( newIdentNode("/"), newIdentNode("std"), newIdentNode("sequtils") ) ), nnkProcDef.newTree( newIdentNode("foo"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("string"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCommand.newTree( newIdentNode("echo"), nnkInfix.newTree( newIdentNode("&"), newIdentNode("x"), newLit("abc") ) ) ) ), nnkCall.newTree( newIdentNode("foo"), nnkCast.newTree( newIdentNode("string"), nnkCall.newTree( newIdentNode("repeat"), newLit('a'), newLit(6) ) ) ) ) ```
1.0.10 :-1: FAIL

Output

``` ```

IR

Compiled filesize 333.49 Kb (341,496 bytes) ```cpp #include "nimbase.h" #include # 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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload {NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 {NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x); static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3varI6stringE)(NimStringV2* dest); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN6repeat6repeatE4char25range09223372036854775807)(NIM_CHAR x, NI n); N_LIB_PRIVATE N_NIMCALL(void, _ZN6newSeq10eqdestroy_E3varI3seqI4charEE)(tySequence__lBgZ7a89beZGYPl8PiANMTA* dest); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); 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); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_BOOL nimInErrorMode__system_u3906; extern TFrame* framePtr__system_u3581; #line 8 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size)));} #line 2230 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size) { #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" nimCopyMem(dest, source, size); } #line 113 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src) {{ #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (!(((NI) 0) < src.len)) goto LA3_; #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt(src.len, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;}; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI) 0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI) 0), ((NI) IL64(9223372036854775807))); goto BeforeRet_;} #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest).p).data[(*dest).len]))), ((void*) ((&(*src.p).data[((NI) 0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt((*dest).len, src.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_;}; (*dest).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" NIM_BOOL* result; result = (NIM_BOOL*)0; #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" result = (&nimInErrorMode__system_u3906); return result;} #line 549 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, nimFrame)(TFrame* s) { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!(framePtr__system_u3581 == ((TFrame*) NIM_NIL))) goto LA3_; #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = (NI16)((*framePtr__system_u3581).calldepth + ((NI16) 1)); } LA1_: ; #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).prev = framePtr__system_u3581; #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3581 = s; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 99 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, popFrame)(void) { #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3581 = (*framePtr__system_u3581).prev;} #line 2 "/home/runner/work/Nim/Nim/temp.nim" N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x) { #line 3 "/home/runner/work/Nim/Nim/temp.nim" NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x.len + 3);appendString((&T3_), x);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" _ZN6system10eqdestroy_E3varI6stringE((&colontmpD_)); } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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) { atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000(); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000(); PreMainInner(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { PreMain(); NimMainInner(); } 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) { #line 999999 "generated_not_to_break_here" { #line 4 "/home/runner/work/Nim/Nim/temp.nim" tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" colontmpD_ = _ZN6repeat6repeatE4char25range09223372036854775807(97, ((NI) 6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 4 "/home/runner/work/Nim/Nim/temp.nim" _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" _ZN6newSeq10eqdestroy_E3varI3seqI4charEE((&colontmpD_)); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T20:12:31
  • Finished 2024-08-24T20:12:31
  • Duration

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( nnkInfix.newTree( newIdentNode("/"), newIdentNode("std"), newIdentNode("sequtils") ) ), nnkProcDef.newTree( newIdentNode("foo"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("string"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCommand.newTree( newIdentNode("echo"), nnkInfix.newTree( newIdentNode("&"), newIdentNode("x"), newLit("abc") ) ) ) ), nnkCall.newTree( newIdentNode("foo"), nnkCast.newTree( newIdentNode("string"), nnkCall.newTree( newIdentNode("repeat"), newLit('a'), newLit(6) ) ) ) ) ```
#a4f9bc55c :arrow_right: :bug:

Diagnostics

cooldome introduced a bug at 2020-10-28 13:00:49 +0000 on commit #a4f9bc55c with message: ``` ARC now capable of custom extra alignment. Ref, closure and seq support. (#15697) (cherry picked from commit 0956a9953780b0952acb56806fdffa8054fe1070) ``` The bug is in the files: ``` compiler/ccgexprs.nim compiler/liftdestructors.nim lib/core/typeinfo.nim lib/system/arc.nim lib/system/bitmasks.nim lib/system/deepcopy.nim lib/system/memalloc.nim lib/system/orc.nim lib/system/seqs_v2.nim tests/arc/thard_alignment.nim tests/collections/thardalignmentconstraint.nim ``` The bug can be in the commits: (Diagnostics sometimes off-by-one).
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 20.4
  • Created 2024-08-24T20:11:33Z
  • Comments 1
  • Commands nim c --gc:arc -d:useMalloc -d:nimArcDebug -d:nimArcIds -d:nimAllocPagesViaMalloc -d:useSysAssert -d:useGcAssert -d:nimLeakDetector --debugger:native --debuginfo:on -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 && valgrind /home/runner/work/Nim/Nim/temp

:robot: Bug found in 20 mins bisecting 327 commits at 16 commits per second

juancarlospaco commented 3 months ago

!nim c --gc:arc -d:useMalloc -d:nosignalhandler --passC:-fsanitize=address --passL:-fsanitize=address

import std/sequtils

proc foo(x: string) =
  echo x & "abc"

foo(cast[string](repeat('a', 6)))
github-actions[bot] commented 3 months ago
:penguin: Linux bisect by @juancarlospaco (collaborator)
devel :-1: FAIL

Output

``` ```

IR

Compiled filesize 477.45 Kb (488,904 bytes) ```cpp #include "nimbase.h" #include #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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0); static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2); static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN8sequtils6repeatE4char25range09223372036854775807)(NIM_CHAR x_p0, NI n_p1); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3seqI4charE)(tySequence__lBgZ7a89beZGYPl8PiANMTA dest_p0); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3982; extern NIM_THREADVAR TFrame* framePtr__system_u2622; #line 8 FX_36 static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; #line 10 FX_36 T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));} #line 2075 FX_2 static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2) { #line 2076 FX_2 nimCopyMem(dest_p0, source_p1, size_p2); } #line 113 FX_40 static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {{ #line 114 FX_40 { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; if (!(((NI)0) < src_p1.len)) goto LA3_; #line 116 FX_40 if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_; } _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 FX_40 if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 444 FX_47 static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; #line 445 FX_47 result = (&nimInErrorMode__system_u3982); return result;} #line 570 FX_47 static N_INLINE(void, nimFrame)(TFrame* s_p0) { #line 571 FX_47 { if (!(framePtr__system_u2622 == ((TFrame*) NIM_NIL))) goto LA3_; #line 572 FX_47 (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { #line 575 FX_47 (*s_p0).calldepth = (NI16)((*framePtr__system_u2622).calldepth + ((NI16)1)); } LA1_: ; #line 577 FX_47 (*s_p0).prev = framePtr__system_u2622; #line 578 FX_47 framePtr__system_u2622 = s_p0; #line 579 FX_47 { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 118 FX_47 static N_INLINE(void, popFrame)(void) { #line 119 FX_47 framePtr__system_u2622 = (*framePtr__system_u2622).prev;} #line 2 FX_31 N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0) { #line 3 FX_31 NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x_p0.len + 3);appendString((&T3_), x_p0);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 378 FX_2 if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p);} } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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; (*inner)(); #else 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) { #line 999999 "generated_not_to_break_here" { #line 4 FX_31 tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD_ = _ZN8sequtils6repeatE4char25range09223372036854775807(97, ((NI)6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 635 FX_2 _ZN6system10eqdestroy_E3seqI4charE(colontmpD_); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T21:11:38
  • Finished 2024-08-24T21:11:41
  • Duration 2 mins

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( nnkInfix.newTree( newIdentNode("/"), newIdentNode("std"), newIdentNode("sequtils") ) ), nnkProcDef.newTree( newIdentNode("foo"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("string"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCommand.newTree( newIdentNode("echo"), nnkInfix.newTree( newIdentNode("&"), newIdentNode("x"), newLit("abc") ) ) ) ), nnkCall.newTree( newIdentNode("foo"), nnkCast.newTree( newIdentNode("string"), nnkCall.newTree( newIdentNode("repeat"), newLit('a'), newLit(6) ) ) ) ) ```
stable :-1: FAIL

Output

``` ```

IR

Compiled filesize 469.45 Kb (480,712 bytes) ```cpp #include "nimbase.h" #include #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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0); static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2); static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN8sequtils6repeatE4char25range09223372036854775807)(NIM_CHAR x_p0, NI n_p1); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3seqI4charE)(tySequence__lBgZ7a89beZGYPl8PiANMTA dest_p0); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3974; extern NIM_THREADVAR TFrame* framePtr__system_u3649; #line 8 FX_37 static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; #line 10 FX_37 T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));} #line 2022 FX_2 static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2) { #line 2023 FX_2 nimCopyMem(dest_p0, source_p1, size_p2); } #line 113 FX_41 static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {{ #line 114 FX_41 { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; if (!(((NI)0) < src_p1.len)) goto LA3_; #line 116 FX_41 if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_; } _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 FX_41 if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 440 FX_48 static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; #line 441 FX_48 result = (&nimInErrorMode__system_u3974); return result;} #line 566 FX_48 static N_INLINE(void, nimFrame)(TFrame* s_p0) { #line 567 FX_48 { if (!(framePtr__system_u3649 == ((TFrame*) NIM_NIL))) goto LA3_; #line 568 FX_48 (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { #line 571 FX_48 (*s_p0).calldepth = (NI16)((*framePtr__system_u3649).calldepth + ((NI16)1)); } LA1_: ; #line 573 FX_48 (*s_p0).prev = framePtr__system_u3649; #line 574 FX_48 framePtr__system_u3649 = s_p0; #line 575 FX_48 { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 114 FX_48 static N_INLINE(void, popFrame)(void) { #line 115 FX_48 framePtr__system_u3649 = (*framePtr__system_u3649).prev;} #line 2 FX_31 N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0) { #line 3 FX_31 NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x_p0.len + 3);appendString((&T3_), x_p0);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 372 FX_2 if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p);} } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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; (*inner)(); #else 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) { #line 999999 "generated_not_to_break_here" { #line 4 FX_31 tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD_ = _ZN8sequtils6repeatE4char25range09223372036854775807(97, ((NI)6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 633 FX_2 _ZN6system10eqdestroy_E3seqI4charE(colontmpD_); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T21:11:44
  • Finished 2024-08-24T21:11:46
  • Duration 1 mins

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( nnkInfix.newTree( newIdentNode("/"), newIdentNode("std"), newIdentNode("sequtils") ) ), nnkProcDef.newTree( newIdentNode("foo"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("string"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCommand.newTree( newIdentNode("echo"), nnkInfix.newTree( newIdentNode("&"), newIdentNode("x"), newLit("abc") ) ) ) ), nnkCall.newTree( newIdentNode("foo"), nnkCast.newTree( newIdentNode("string"), nnkCall.newTree( newIdentNode("repeat"), newLit('a'), newLit(6) ) ) ) ) ```
2.0.8 :-1: FAIL

Output

``` ```

IR

Compiled filesize 469.45 Kb (480,712 bytes) ```cpp #include "nimbase.h" #include #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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0); static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2); static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN8sequtils6repeatE4char25range09223372036854775807)(NIM_CHAR x_p0, NI n_p1); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3seqI4charE)(tySequence__lBgZ7a89beZGYPl8PiANMTA dest_p0); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3974; extern NIM_THREADVAR TFrame* framePtr__system_u3649; #line 8 FX_37 static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; #line 10 FX_37 T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));} #line 2022 FX_2 static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest_p0, void* source_p1, NI size_p2) { #line 2023 FX_2 nimCopyMem(dest_p0, source_p1, size_p2); } #line 113 FX_41 static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {{ #line 114 FX_41 { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; if (!(((NI)0) < src_p1.len)) goto LA3_; #line 116 FX_41 if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_; } _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 FX_41 if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 440 FX_48 static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; #line 441 FX_48 result = (&nimInErrorMode__system_u3974); return result;} #line 566 FX_48 static N_INLINE(void, nimFrame)(TFrame* s_p0) { #line 567 FX_48 { if (!(framePtr__system_u3649 == ((TFrame*) NIM_NIL))) goto LA3_; #line 568 FX_48 (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { #line 571 FX_48 (*s_p0).calldepth = (NI16)((*framePtr__system_u3649).calldepth + ((NI16)1)); } LA1_: ; #line 573 FX_48 (*s_p0).prev = framePtr__system_u3649; #line 574 FX_48 framePtr__system_u3649 = s_p0; #line 575 FX_48 { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 114 FX_48 static N_INLINE(void, popFrame)(void) { #line 115 FX_48 framePtr__system_u3649 = (*framePtr__system_u3649).prev;} #line 2 FX_31 N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x_p0) { #line 3 FX_31 NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x_p0.len + 3);appendString((&T3_), x_p0);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 372 FX_2 if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p);} } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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; (*inner)(); #else 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) { #line 999999 "generated_not_to_break_here" { #line 4 FX_31 tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD_ = _ZN8sequtils6repeatE4char25range09223372036854775807(97, ((NI)6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 633 FX_2 _ZN6system10eqdestroy_E3seqI4charE(colontmpD_); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T21:11:46
  • Finished 2024-08-24T21:11:48
  • Duration 1 mins

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( nnkInfix.newTree( newIdentNode("/"), newIdentNode("std"), newIdentNode("sequtils") ) ), nnkProcDef.newTree( newIdentNode("foo"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("string"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCommand.newTree( newIdentNode("echo"), nnkInfix.newTree( newIdentNode("&"), newIdentNode("x"), newLit("abc") ) ) ) ), nnkCall.newTree( newIdentNode("foo"), nnkCast.newTree( newIdentNode("string"), nnkCall.newTree( newIdentNode("repeat"), newLit('a'), newLit(6) ) ) ) ) ```
2.0.0 :-1: FAIL

Output

``` ```

IR

Compiled filesize 429.55 Kb (439,856 bytes) ```cpp #include "nimbase.h" #include #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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, foo__temp_u2)(NimStringV2 x_p0); static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1); static N_INLINE(void, copyMem__system_u1745)(void* dest_p0, void* source_p1, NI size_p2); static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4155)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, repeat__temp_u4)(NIM_CHAR x_p0, NI n_p1); N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u122)(tySequence__lBgZ7a89beZGYPl8PiANMTA dest_p0); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3963; extern NIM_THREADVAR TFrame* framePtr__system_u3601; #line 8 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/memory.nim" static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; #line 10 T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));} #line 2016 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim" static N_INLINE(void, copyMem__system_u1745)(void* dest_p0, void* source_p1, NI size_p2) { #line 2017 nimCopyMem(dest_p0, source_p1, size_p2); } #line 94 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/strs_v2.nim" static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {{ #line 95 { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; if (!(((NI)0) < src_p1.len)) goto LA3_; #line 97 if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_; } copyMem__system_u1745(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 98 if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 423 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/excpt.nim" static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (NIM_BOOL*)0; #line 424 result = (&nimInErrorMode__system_u3963); return result;} #line 549 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/excpt.nim" static N_INLINE(void, nimFrame)(TFrame* s_p0) { #line 550 { if (!(framePtr__system_u3601 == ((TFrame*) NIM_NIL))) goto LA3_; #line 551 (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { #line 554 (*s_p0).calldepth = (NI16)((*framePtr__system_u3601).calldepth + ((NI16)1)); } LA1_: ; #line 556 (*s_p0).prev = framePtr__system_u3601; #line 557 framePtr__system_u3601 = s_p0; #line 558 { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4155(); } LA8_: ; } #line 99 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/excpt.nim" static N_INLINE(void, popFrame)(void) { #line 100 framePtr__system_u3601 = (*framePtr__system_u3601).prev;} #line 2 "/home/runner/work/Nim/Nim/temp.nim" N_LIB_PRIVATE N_NIMCALL(void, foo__temp_u2)(NimStringV2 x_p0) { #line 3 NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x_p0.len + 3);appendString((&T3_), x_p0);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 370 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim" if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p);} } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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; (*inner)(); #else 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) { #line 999999 "generated_not_to_break_here" { #line 4 "/home/runner/work/Nim/Nim/temp.nim" tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD_ = repeat__temp_u4(97, ((NI)6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; foo__temp_u2((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 635 "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim" eqdestroy___temp_u122(colontmpD_); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T21:11:51
  • Finished 2024-08-24T21:11:52
  • Duration 1 mins

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( nnkInfix.newTree( newIdentNode("/"), newIdentNode("std"), newIdentNode("sequtils") ) ), nnkProcDef.newTree( newIdentNode("foo"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("string"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCommand.newTree( newIdentNode("echo"), nnkInfix.newTree( newIdentNode("&"), newIdentNode("x"), newLit("abc") ) ) ) ), nnkCall.newTree( newIdentNode("foo"), nnkCast.newTree( newIdentNode("string"), nnkCall.newTree( newIdentNode("repeat"), newLit('a'), newLit(6) ) ) ) ) ```
1.6.20 :-1: FAIL

Output

``` ```

IR

Compiled filesize 435.48 Kb (445,928 bytes) ```cpp #include "nimbase.h" #include # 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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload {NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 {NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x); static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3varI6stringE)(NimStringV2* dest); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN6repeat6repeatE4char25range09223372036854775807)(NIM_CHAR x, NI n); N_LIB_PRIVATE N_NIMCALL(void, _ZN6newSeq10eqdestroy_E3varI3seqI4charEE)(tySequence__lBgZ7a89beZGYPl8PiANMTA* dest); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); 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); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_BOOL nimInErrorMode__system_u3905; extern TFrame* framePtr__system_u3580; #line 8 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size)));} #line 2230 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size) { #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" nimCopyMem(dest, source, size); } #line 113 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src) {{ #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (!(((NI) 0) < src.len)) goto LA3_; #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt(src.len, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;}; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI) 0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI) 0), ((NI) IL64(9223372036854775807))); goto BeforeRet_;} #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest).p).data[(*dest).len]))), ((void*) ((&(*src.p).data[((NI) 0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt((*dest).len, src.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_;}; (*dest).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" NIM_BOOL* result; result = (NIM_BOOL*)0; #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" result = (&nimInErrorMode__system_u3905); return result;} #line 549 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, nimFrame)(TFrame* s) { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!(framePtr__system_u3580 == ((TFrame*) NIM_NIL))) goto LA3_; #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = (NI16)((*framePtr__system_u3580).calldepth + ((NI16) 1)); } LA1_: ; #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).prev = framePtr__system_u3580; #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3580 = s; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 99 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, popFrame)(void) { #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3580 = (*framePtr__system_u3580).prev;} #line 2 "/home/runner/work/Nim/Nim/temp.nim" N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x) { #line 3 "/home/runner/work/Nim/Nim/temp.nim" NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x.len + 3);appendString((&T3_), x);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" _ZN6system10eqdestroy_E3varI6stringE((&colontmpD_)); } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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) { atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000(); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000(); PreMainInner(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { PreMain(); NimMainInner(); } 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) { #line 999999 "generated_not_to_break_here" { #line 4 "/home/runner/work/Nim/Nim/temp.nim" tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" colontmpD_ = _ZN6repeat6repeatE4char25range09223372036854775807(97, ((NI) 6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 4 "/home/runner/work/Nim/Nim/temp.nim" _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" _ZN6newSeq10eqdestroy_E3varI3seqI4charEE((&colontmpD_)); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T21:11:55
  • Finished 2024-08-24T21:11:56
  • Duration 1 mins

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( nnkInfix.newTree( newIdentNode("/"), newIdentNode("std"), newIdentNode("sequtils") ) ), nnkProcDef.newTree( newIdentNode("foo"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("string"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCommand.newTree( newIdentNode("echo"), nnkInfix.newTree( newIdentNode("&"), newIdentNode("x"), newLit("abc") ) ) ) ), nnkCall.newTree( newIdentNode("foo"), nnkCast.newTree( newIdentNode("string"), nnkCall.newTree( newIdentNode("repeat"), newLit('a'), newLit(6) ) ) ) ) ```
1.4.8 :-1: FAIL

Output

``` ```

IR

Compiled filesize 435.48 Kb (445,928 bytes) ```cpp #include "nimbase.h" #include # 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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload {NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 {NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x); static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3varI6stringE)(NimStringV2* dest); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN6repeat6repeatE4char25range09223372036854775807)(NIM_CHAR x, NI n); N_LIB_PRIVATE N_NIMCALL(void, _ZN6newSeq10eqdestroy_E3varI3seqI4charEE)(tySequence__lBgZ7a89beZGYPl8PiANMTA* dest); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); 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); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_BOOL nimInErrorMode__system_u3905; extern TFrame* framePtr__system_u3580; #line 8 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size)));} #line 2230 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size) { #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" nimCopyMem(dest, source, size); } #line 113 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src) {{ #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (!(((NI) 0) < src.len)) goto LA3_; #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt(src.len, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;}; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI) 0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI) 0), ((NI) IL64(9223372036854775807))); goto BeforeRet_;} #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest).p).data[(*dest).len]))), ((void*) ((&(*src.p).data[((NI) 0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt((*dest).len, src.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_;}; (*dest).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" NIM_BOOL* result; result = (NIM_BOOL*)0; #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" result = (&nimInErrorMode__system_u3905); return result;} #line 549 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, nimFrame)(TFrame* s) { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!(framePtr__system_u3580 == ((TFrame*) NIM_NIL))) goto LA3_; #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = (NI16)((*framePtr__system_u3580).calldepth + ((NI16) 1)); } LA1_: ; #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).prev = framePtr__system_u3580; #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3580 = s; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 99 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, popFrame)(void) { #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3580 = (*framePtr__system_u3580).prev;} #line 2 "/home/runner/work/Nim/Nim/temp.nim" N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x) { #line 3 "/home/runner/work/Nim/Nim/temp.nim" NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x.len + 3);appendString((&T3_), x);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" _ZN6system10eqdestroy_E3varI6stringE((&colontmpD_)); } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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) { atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000(); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000(); PreMainInner(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { PreMain(); NimMainInner(); } 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) { #line 999999 "generated_not_to_break_here" { #line 4 "/home/runner/work/Nim/Nim/temp.nim" tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" colontmpD_ = _ZN6repeat6repeatE4char25range09223372036854775807(97, ((NI) 6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 4 "/home/runner/work/Nim/Nim/temp.nim" _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" _ZN6newSeq10eqdestroy_E3varI3seqI4charEE((&colontmpD_)); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T21:11:59
  • Finished 2024-08-24T21:11:59
  • Duration

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( nnkInfix.newTree( newIdentNode("/"), newIdentNode("std"), newIdentNode("sequtils") ) ), nnkProcDef.newTree( newIdentNode("foo"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("string"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCommand.newTree( newIdentNode("echo"), nnkInfix.newTree( newIdentNode("&"), newIdentNode("x"), newLit("abc") ) ) ) ), nnkCall.newTree( newIdentNode("foo"), nnkCast.newTree( newIdentNode("string"), nnkCall.newTree( newIdentNode("repeat"), newLit('a'), newLit(6) ) ) ) ) ```
1.2.18 :-1: FAIL

Output

``` ```

IR

Compiled filesize 435.48 Kb (445,928 bytes) ```cpp #include "nimbase.h" #include # 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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload {NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 {NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x); static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3varI6stringE)(NimStringV2* dest); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN6repeat6repeatE4char25range09223372036854775807)(NIM_CHAR x, NI n); N_LIB_PRIVATE N_NIMCALL(void, _ZN6newSeq10eqdestroy_E3varI3seqI4charEE)(tySequence__lBgZ7a89beZGYPl8PiANMTA* dest); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); 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); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_BOOL nimInErrorMode__system_u3905; extern TFrame* framePtr__system_u3580; #line 8 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size)));} #line 2230 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size) { #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" nimCopyMem(dest, source, size); } #line 113 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src) {{ #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (!(((NI) 0) < src.len)) goto LA3_; #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt(src.len, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;}; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI) 0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI) 0), ((NI) IL64(9223372036854775807))); goto BeforeRet_;} #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest).p).data[(*dest).len]))), ((void*) ((&(*src.p).data[((NI) 0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt((*dest).len, src.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_;}; (*dest).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" NIM_BOOL* result; result = (NIM_BOOL*)0; #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" result = (&nimInErrorMode__system_u3905); return result;} #line 549 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, nimFrame)(TFrame* s) { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!(framePtr__system_u3580 == ((TFrame*) NIM_NIL))) goto LA3_; #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = (NI16)((*framePtr__system_u3580).calldepth + ((NI16) 1)); } LA1_: ; #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).prev = framePtr__system_u3580; #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3580 = s; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 99 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, popFrame)(void) { #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3580 = (*framePtr__system_u3580).prev;} #line 2 "/home/runner/work/Nim/Nim/temp.nim" N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x) { #line 3 "/home/runner/work/Nim/Nim/temp.nim" NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x.len + 3);appendString((&T3_), x);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" _ZN6system10eqdestroy_E3varI6stringE((&colontmpD_)); } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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) { atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000(); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000(); PreMainInner(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { PreMain(); NimMainInner(); } 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) { #line 999999 "generated_not_to_break_here" { #line 4 "/home/runner/work/Nim/Nim/temp.nim" tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" colontmpD_ = _ZN6repeat6repeatE4char25range09223372036854775807(97, ((NI) 6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 4 "/home/runner/work/Nim/Nim/temp.nim" _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" _ZN6newSeq10eqdestroy_E3varI3seqI4charEE((&colontmpD_)); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T21:12:02
  • Finished 2024-08-24T21:12:02
  • Duration

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( nnkInfix.newTree( newIdentNode("/"), newIdentNode("std"), newIdentNode("sequtils") ) ), nnkProcDef.newTree( newIdentNode("foo"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("string"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCommand.newTree( newIdentNode("echo"), nnkInfix.newTree( newIdentNode("&"), newIdentNode("x"), newLit("abc") ) ) ) ), nnkCall.newTree( newIdentNode("foo"), nnkCast.newTree( newIdentNode("string"), nnkCall.newTree( newIdentNode("repeat"), newLit('a'), newLit(6) ) ) ) ) ```
1.0.10 :-1: FAIL

Output

``` ```

IR

Compiled filesize 435.48 Kb (445,928 bytes) ```cpp #include "nimbase.h" #include # 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; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA tySequence__lBgZ7a89beZGYPl8PiANMTA; typedef struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content tySequence__lBgZ7a89beZGYPl8PiANMTA_Content; typedef struct NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct tySequence__lBgZ7a89beZGYPl8PiANMTA { NI len; tySequence__lBgZ7a89beZGYPl8PiANMTA_Content* p; }; struct NimStrPayload {NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 {NI len; NimStrPayload* p; }; typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1]; #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif #ifndef tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP #define tySequence__lBgZ7a89beZGYPl8PiANMTA_Content_PP struct tySequence__lBgZ7a89beZGYPl8PiANMTA_Content { NI cap; NIM_CHAR data[SEQ_DECL_SIZE];}; #endif N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x); static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src); static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void); N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space); N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0); N_LIB_PRIVATE N_NIMCALL(void, _ZN6system10eqdestroy_E3varI6stringE)(NimStringV2* dest); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, _ZN6system21callDepthLimitReachedE)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(tySequence__lBgZ7a89beZGYPl8PiANMTA, _ZN6repeat6repeatE4char25range09223372036854775807)(NIM_CHAR x, NI n); N_LIB_PRIVATE N_NIMCALL(void, _ZN6newSeq10eqdestroy_E3varI3seqI4charEE)(tySequence__lBgZ7a89beZGYPl8PiANMTA* dest); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); 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); static const struct { NI cap; NIM_CHAR data[3+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 3 | NIM_STRLIT_FLAG, "abc" }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4}; extern NIM_BOOL nimInErrorMode__system_u3905; extern TFrame* framePtr__system_u3580; #line 8 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" #line 10 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/memory.nim" T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size)));} #line 2230 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" static N_INLINE(void, _ZN6system7copyMemE7pointer7pointer25range09223372036854775807)(void* dest, void* source, NI size) { #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 2231 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" nimCopyMem(dest, source, size); } #line 113 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src) {{ #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" { NI TM__SRd76hP9cMfCzdUO857UhQQ_2; NI TM__SRd76hP9cMfCzdUO857UhQQ_3; #line 114 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (!(((NI) 0) < src.len)) goto LA3_; #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt(src.len, ((NI) 1), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;}; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) < ((NI) 0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2), ((NI) 0), ((NI) IL64(9223372036854775807))); goto BeforeRet_;} #line 116 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" _ZN6system7copyMemE7pointer7pointer25range09223372036854775807(((void*) ((&(*(*dest).p).data[(*dest).len]))), ((void*) ((&(*src.p).data[((NI) 0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2)))); #line 117 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/strs_v2.nim" if (nimAddInt((*dest).len, src.len, &TM__SRd76hP9cMfCzdUO857UhQQ_3)) { raiseOverflow(); goto BeforeRet_;}; (*dest).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_3); } LA3_: ; }BeforeRet_: ; } #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { #line 423 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" NIM_BOOL* result; result = (NIM_BOOL*)0; #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 424 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" result = (&nimInErrorMode__system_u3905); return result;} #line 549 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, nimFrame)(TFrame* s) { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 550 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!(framePtr__system_u3580 == ((TFrame*) NIM_NIL))) goto LA3_; #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 551 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 554 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).calldepth = (NI16)((*framePtr__system_u3580).calldepth + ((NI16) 1)); } LA1_: ; #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 556 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" (*s).prev = framePtr__system_u3580; #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 557 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3580 = s; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" { #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 558 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" _ZN6system21callDepthLimitReachedE(); } LA8_: ; } #line 99 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" static N_INLINE(void, popFrame)(void) { #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" #line 100 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/excpt.nim" framePtr__system_u3580 = (*framePtr__system_u3580).prev;} #line 2 "/home/runner/work/Nim/Nim/temp.nim" N_LIB_PRIVATE N_NIMCALL(void, _ZN4temp3fooE6string)(NimStringV2 x) { #line 3 "/home/runner/work/Nim/Nim/temp.nim" NimStringV2 colontmpD_; tyArray__nHXaesL0DJZHyVS07ARPRA T2_; NimStringV2 T3_;NIM_BOOL* nimErr_; nimfr_("foo", "/home/runner/work/Nim/Nim/temp.nim");{nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" #line 3 "/home/runner/work/Nim/Nim/temp.nim" T3_.len = 0; T3_.p = NIM_NIL; T3_ = rawNewString(x.len + 3);appendString((&T3_), x);appendString((&T3_), TM__SRd76hP9cMfCzdUO857UhQQ_5); colontmpD_ = T3_; T2_[0] = colontmpD_; echoBinSafe(T2_, 1); { LA1_:; } { #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" #line 54 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim" _ZN6system10eqdestroy_E3varI6stringE((&colontmpD_)); } if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; popFrame();} 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) { atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000(); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000(); PreMainInner(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { PreMain(); NimMainInner(); } 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) { #line 999999 "generated_not_to_break_here" { #line 4 "/home/runner/work/Nim/Nim/temp.nim" tySequence__lBgZ7a89beZGYPl8PiANMTA colontmpD_;NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");nimErr_ = nimErrorFlag(); colontmpD_.len = 0; colontmpD_.p = NIM_NIL; #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" #line 4 "/home/runner/work/Nim/Nim/temp.nim" colontmpD_ = _ZN6repeat6repeatE4char25range09223372036854775807(97, ((NI) 6)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 4 "/home/runner/work/Nim/Nim/temp.nim" _ZN4temp3fooE6string((*(NimStringV2*) (&colontmpD_))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" #line 680 "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system.nim" _ZN6newSeq10eqdestroy_E3varI3seqI4charEE((&colontmpD_)); BeforeRet_: ; nimTestErrorFlag(); popFrame();} } ```

Stats

  • Started 2024-08-24T21:12:04
  • Finished 2024-08-24T21:12:04
  • Duration

AST

```nim nnkStmtList.newTree( nnkImportStmt.newTree( nnkInfix.newTree( newIdentNode("/"), newIdentNode("std"), newIdentNode("sequtils") ) ), nnkProcDef.newTree( newIdentNode("foo"), newEmptyNode(), newEmptyNode(), nnkFormalParams.newTree( newEmptyNode(), nnkIdentDefs.newTree( newIdentNode("x"), newIdentNode("string"), newEmptyNode() ) ), newEmptyNode(), newEmptyNode(), nnkStmtList.newTree( nnkCommand.newTree( newIdentNode("echo"), nnkInfix.newTree( newIdentNode("&"), newIdentNode("x"), newLit("abc") ) ) ) ), nnkCall.newTree( newIdentNode("foo"), nnkCast.newTree( newIdentNode("string"), nnkCall.newTree( newIdentNode("repeat"), newLit('a'), newLit(6) ) ) ) ) ```
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 20.4
  • Created 2024-08-24T21:11:00Z
  • Comments 3
  • Commands nim c --gc:arc -d:useMalloc -d:nosignalhandler --passC:-fsanitize=address --passL:-fsanitize=address -d:nimArcDebug -d:nimArcIds -d:nimAllocPagesViaMalloc -d:useSysAssert -d:useGcAssert -d:nimLeakDetector --debugger:native --debuginfo:on -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 && valgrind /home/runner/work/Nim/Nim/temp

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

Araq commented 3 months ago

Interesting this means casting from seq to string never was supported. :-)