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

Put 0 in range[M..N] that would otherwise exclude it #23943

Closed kuche1 closed 1 month ago

kuche1 commented 1 month ago

Description

I'm able to put a 0 in a range that shouldn't allow this value

type limited_int = range[1..20]
var d: limited_int;
echo d

Nim Version

Nim Compiler Version 2.0.4 [Linux: amd64] Compiled at 2024-05-04 Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 08d9e6af883be33239a88b36f6f5416e06a9ea84 active boot switches: -d:release

Current Output

`0`

Expected Output

`1` or an error

Possible Solution

No response

Additional Information

No response

juancarlospaco commented 1 month ago

!nim c

type limited_int = range[1..20]
var d: limited_int
doAssert d == 1, $d
github-actions[bot] commented 1 month ago
:penguin: Linux bisect by @juancarlospaco (collaborator)
devel :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-#devel/lib/std/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-#devel/lib/std/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-#devel/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(3, 1) `d == 1` 0 [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp' assertions.nim(34) raiseAssert Error: unhandled exception: errGenerated [AssertionDefect] ```

IR

Compiled filesize 97.75 Kb (100,096 bytes) ```cpp #define NIM_INTBITS 64 #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 NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u235)(NimStringV2 msg_p0); static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1); static N_INLINE(void, copyMem__system_u1722)(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, dollar___systemZdollars_u8)(NI x_p0); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4613)(void); static N_INLINE(void, popFrame)(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[50+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 50 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(3, 1) `d == 1` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {50, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; N_LIB_PRIVATE NI d__temp_u2; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4397; extern NIM_THREADVAR TFrame* framePtr__system_u2654; static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2))); } static N_INLINE(void, copyMem__system_u1722)(void* dest_p0, void* source_p1, NI size_p2) { nimCopyMem(dest_p0, source_p1, size_p2); } static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) { { { NI TM__SRd76hP9cMfCzdUO857UhQQ_4; NI TM__SRd76hP9cMfCzdUO857UhQQ_5; if (!(((NI)0) < src_p1.len)) goto LA3_; if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_4)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_; } copyMem__system_u1722(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), ((NI) ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4)))); if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_5)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_5); } LA3_: ; }BeforeRet_: ; } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (&nimInErrorMode__system_u4397); return result; } static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u2654 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u2654).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u2654; framePtr__system_u2654 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4613(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u2654 = (*framePtr__system_u2654).prev; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); { NimStringV2 colontmpD_; NimStringV2 colontmpD__2; NimStringV2 T5_; if (!!((((NI) (d__temp_u2)) == ((NI)1)))) goto LA3_; colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL; T5_.len = 0; T5_.p = NIM_NIL; colontmpD_ = dollar___systemZdollars_u8(((NI) (d__temp_u2))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; T5_ = rawNewString(colontmpD_.len + 50); appendString((&T5_), TM__SRd76hP9cMfCzdUO857UhQQ_3); appendString((&T5_), colontmpD_); colontmpD__2 = T5_; failedAssertImpl__stdZassertions_u235(colontmpD__2); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__2.p); } if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p); } } LA3_: ; BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2024-08-12T18:57:24
  • Finished 2024-08-12T18:57:24
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( newIdentNode("limited_int"), newEmptyNode(), nnkBracketExpr.newTree( newIdentNode("range"), nnkInfix.newTree( newIdentNode(".."), newLit(1), newLit(20) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("d"), newIdentNode("limited_int"), newEmptyNode() ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("d"), newLit(1) ), nnkPrefix.newTree( newIdentNode("$"), newIdentNode("d") ) ) ) ```
stable :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-2.0.8/lib/std/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-2.0.8/lib/std/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-2.0.8/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(3, 1) `d == 1` 0 [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp' assertions.nim(34) raiseAssert Error: unhandled exception: options.nim(682, 5) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 93.71 Kb (95,960 bytes) ```cpp #define NIM_INTBITS 64 #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 NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u270)(NimStringV2 msg_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, dollar___systemZdollars_u8)(NI x_p0); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4620)(void); static N_INLINE(void, popFrame)(void); 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[50+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 50 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(3, 1) `d == 1` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {50, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; N_LIB_PRIVATE NI d__temp_u2; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4402; extern NIM_THREADVAR TFrame* framePtr__system_u4059; static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2))); } static N_INLINE(void, copyMem__system_u1745)(void* dest_p0, void* source_p1, NI size_p2) { nimCopyMem(dest_p0, source_p1, size_p2); } static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) { { { NI TM__SRd76hP9cMfCzdUO857UhQQ_4; NI TM__SRd76hP9cMfCzdUO857UhQQ_5; if (!(((NI)0) < src_p1.len)) goto LA3_; if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_4)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4), ((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_4)))); if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_5)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_5); } LA3_: ; }BeforeRet_: ; } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (&nimInErrorMode__system_u4402); return result; } static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u4059 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u4059).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u4059; framePtr__system_u4059 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4620(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u4059 = (*framePtr__system_u4059).prev; } N_LIB_PRIVATE 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) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); { NimStringV2 colontmpD_; NimStringV2 colontmpD__2; NimStringV2 T5_; if (!!((((NI) (d__temp_u2)) == ((NI)1)))) goto LA3_; colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL; T5_.len = 0; T5_.p = NIM_NIL; colontmpD_ = dollar___systemZdollars_u8(((NI) (d__temp_u2))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; T5_ = rawNewString(colontmpD_.len + 50); appendString((&T5_), TM__SRd76hP9cMfCzdUO857UhQQ_3); appendString((&T5_), colontmpD_); colontmpD__2 = T5_; failedAssertImpl__stdZassertions_u270(colontmpD__2); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__2.p); } if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p); } } LA3_: ; BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2024-08-12T18:57:28
  • Finished 2024-08-12T18:57:28
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( newIdentNode("limited_int"), newEmptyNode(), nnkBracketExpr.newTree( newIdentNode("range"), nnkInfix.newTree( newIdentNode(".."), newLit(1), newLit(20) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("d"), newIdentNode("limited_int"), newEmptyNode() ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("d"), newLit(1) ), nnkPrefix.newTree( newIdentNode("$"), newIdentNode("d") ) ) ) ```
2.0.4 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-2.0.4/lib/std/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-2.0.4/lib/std/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-2.0.4/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(3, 1) `d == 1` 0 [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp' assertions.nim(34) raiseAssert Error: unhandled exception: options.nim(681, 5) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 91.67 Kb (93,872 bytes) ```cpp #define NIM_INTBITS 64 #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 NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u310)(NimStringV2 msg_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, dollar___systemZdollars_u8)(NI x_p0); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4621)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); static const struct { NI cap; NIM_CHAR data[50+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 50 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(3, 1) `d == 1` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {50, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; N_LIB_PRIVATE NI d__temp_u2; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4403; extern NIM_THREADVAR TFrame* framePtr__system_u4020; static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2))); } static N_INLINE(void, copyMem__system_u1745)(void* dest_p0, void* source_p1, NI size_p2) { nimCopyMem(dest_p0, source_p1, size_p2); } static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) { { { NI TM__SRd76hP9cMfCzdUO857UhQQ_4; NI TM__SRd76hP9cMfCzdUO857UhQQ_5; if (!(((NI)0) < src_p1.len)) goto LA3_; if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_4)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4), ((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_4)))); if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_5)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_5); } LA3_: ; }BeforeRet_: ; } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (&nimInErrorMode__system_u4403); return result; } static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u4020 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u4020).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u4020; framePtr__system_u4020 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4621(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u4020 = (*framePtr__system_u4020).prev; } 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; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); { NimStringV2 colontmpD_; NimStringV2 colontmpD__2; NimStringV2 T5_; if (!!((((NI) (d__temp_u2)) == ((NI)1)))) goto LA3_; colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL; T5_.len = 0; T5_.p = NIM_NIL; colontmpD_ = dollar___systemZdollars_u8(((NI) (d__temp_u2))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; T5_ = rawNewString(colontmpD_.len + 50); appendString((&T5_), TM__SRd76hP9cMfCzdUO857UhQQ_3); appendString((&T5_), colontmpD_); colontmpD__2 = T5_; failedAssertImpl__stdZassertions_u310(colontmpD__2); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__2.p); } if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p); } } LA3_: ; BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2024-08-12T18:57:31
  • Finished 2024-08-12T18:57:32
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( newIdentNode("limited_int"), newEmptyNode(), nnkBracketExpr.newTree( newIdentNode("range"), nnkInfix.newTree( newIdentNode(".."), newLit(1), newLit(20) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("d"), newIdentNode("limited_int"), newEmptyNode() ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("d"), newLit(1) ), nnkPrefix.newTree( newIdentNode("$"), newIdentNode("d") ) ) ) ```
2.0.0 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-2.0.0/lib/std/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-2.0.0/lib/std/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(3, 1) `d == 1` 0 [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp' assertions.nim(34) raiseAssert Error: unhandled exception: options.nim(664, 5) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 91.68 Kb (93,880 bytes) ```cpp #define NIM_INTBITS 64 #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 NimStrPayload NimStrPayload; typedef struct NimStringV2 NimStringV2; struct NimStrPayload { NI cap; NIM_CHAR data[SEQ_DECL_SIZE]; }; struct NimStringV2 { NI len; NimStrPayload* p; }; N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u310)(NimStringV2 msg_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, dollar___systemZdollars_u8)(NI x_p0); N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0); N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void); static N_INLINE(void, nimFrame)(TFrame* s_p0); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4607)(void); static N_INLINE(void, popFrame)(void); 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[50+1]; } TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 50 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(3, 1) `d == 1` " }; static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {50, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2}; N_LIB_PRIVATE NI d__temp_u2; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4389; extern NIM_THREADVAR TFrame* framePtr__system_u4006; static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) { void* T1_; T1_ = (void*)0; T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2))); } static N_INLINE(void, copyMem__system_u1745)(void* dest_p0, void* source_p1, NI size_p2) { nimCopyMem(dest_p0, source_p1, size_p2); } static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) { { { NI TM__SRd76hP9cMfCzdUO857UhQQ_4; NI TM__SRd76hP9cMfCzdUO857UhQQ_5; if (!(((NI)0) < src_p1.len)) goto LA3_; if (nimAddInt(src_p1.len, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_4)) { raiseOverflow(); goto BeforeRet_; }; if (((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4)) < ((NI)0) || ((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4), ((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_4)))); if (nimAddInt((*dest_p0).len, src_p1.len, &TM__SRd76hP9cMfCzdUO857UhQQ_5)) { raiseOverflow(); goto BeforeRet_; }; (*dest_p0).len = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_5); } LA3_: ; }BeforeRet_: ; } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (NIM_BOOL*)0; result = (&nimInErrorMode__system_u4389); return result; } static N_INLINE(void, nimFrame)(TFrame* s_p0) { { if (!(framePtr__system_u4006 == ((TFrame*) NIM_NIL))) goto LA3_; (*s_p0).calldepth = ((NI16)0); } goto LA1_; LA3_: ; { (*s_p0).calldepth = (NI16)((*framePtr__system_u4006).calldepth + ((NI16)1)); } LA1_: ; (*s_p0).prev = framePtr__system_u4006; framePtr__system_u4006 = s_p0; { if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_; callDepthLimitReached__system_u4607(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u4006 = (*framePtr__system_u4006).prev; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { #if 0 void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000(); (*inner)(); #else atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000(); PreMainInner(); #endif } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { #if 0 void (*volatile inner)(void); PreMain(); inner = NimMainInner; (*inner)(); #else PreMain(); NimMainInner(); #endif } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { NIM_BOOL* nimErr_; nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); nimErr_ = nimErrorFlag(); { NimStringV2 colontmpD_; NimStringV2 colontmpD__2; NimStringV2 T5_; if (!!((((NI) (d__temp_u2)) == ((NI)1)))) goto LA3_; colontmpD_.len = 0; colontmpD_.p = NIM_NIL; colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL; T5_.len = 0; T5_.p = NIM_NIL; colontmpD_ = dollar___systemZdollars_u8(((NI) (d__temp_u2))); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; T5_ = rawNewString(colontmpD_.len + 50); appendString((&T5_), TM__SRd76hP9cMfCzdUO857UhQQ_3); appendString((&T5_), colontmpD_); colontmpD__2 = T5_; failedAssertImpl__stdZassertions_u310(colontmpD__2); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD__2.p); } if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) { deallocShared(colontmpD_.p); } } LA3_: ; BeforeRet_: ; nimTestErrorFlag(); popFrame(); } } ```

Stats

  • Started 2024-08-12T18:57:34
  • Finished 2024-08-12T18:57:35
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( newIdentNode("limited_int"), newEmptyNode(), nnkBracketExpr.newTree( newIdentNode("range"), nnkInfix.newTree( newIdentNode(".."), newLit(1), newLit(20) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("d"), newIdentNode("limited_int"), newEmptyNode() ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("d"), newLit(1) ), nnkPrefix.newTree( newIdentNode("$"), newIdentNode("d") ) ) ) ```
1.6.20 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(3, 10) `d == 1` 0 [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp ' fatal.nim(54) sysFatal Error: unhandled exception: options.nim(662, 14) `false` errGenerated [AssertionDefect] ```

IR

Compiled filesize 96.16 Kb (98,472 bytes) ```cpp #define NIM_INTBITS 64 #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 NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__systemZassertions_u56)(NimStringDesc* msg); static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src); static N_INLINE(void, copyMem__system_u1733)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___systemZdollars_u3)(NI x); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u2997)(void); static N_INLINE(void, popFrame)(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); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "/home/runner/work/Nim/Nim/temp.nim(3, 10) `d == 1` ", 51); N_LIB_PRIVATE NI d__temp_u2; extern TFrame* framePtr__system_u2564; static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size))); } static N_INLINE(void, copyMem__system_u1733)(void* dest, void* source, NI size) { nimCopyMem(dest, source, size); } static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) { { if (!!((src == ((NimStringDesc*) NIM_NIL)))) goto LA3_; copyMem__system_u1733(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1))))); (*dest).Sup.len += (*src).Sup.len; } LA3_: ; } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__system_u2564 == ((TFrame*) NIM_NIL))) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__system_u2564).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__system_u2564; framePtr__system_u2564 = s; { if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; callDepthLimitReached__system_u2997(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__system_u2564 = (*framePtr__system_u2564).prev; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000(); initStackBottomWith((void *)&inner); atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); { NimStringDesc* T5_; NimStringDesc* T6_; if (!!((((NI) (d__temp_u2)) == ((NI) 1)))) goto LA3_; T5_ = NIM_NIL; T6_ = NIM_NIL; T6_ = dollar___systemZdollars_u3(((NI) (d__temp_u2))); T5_ = rawNewString((T6_ ? T6_->Sup.len : 0) + 51); appendString(T5_, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); appendString(T5_, T6_); failedAssertImpl__systemZassertions_u56(T5_); } LA3_: ; popFrame(); } } ```

Stats

  • Started 2024-08-12T18:57:38
  • Finished 2024-08-12T18:57:39
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( newIdentNode("limited_int"), newEmptyNode(), nnkBracketExpr.newTree( newIdentNode("range"), nnkInfix.newTree( newIdentNode(".."), newLit(1), newLit(20) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("d"), newIdentNode("limited_int"), newEmptyNode() ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("d"), newLit(1) ), nnkPrefix.newTree( newIdentNode("$"), newIdentNode("d") ) ) ) ```
1.4.8 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(3, 10) `d == 1` 0 [AssertionDefect] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp ' ```

IR

Compiled filesize 91.80 Kb (94,000 bytes) ```cpp #define NIM_INTBITS 64 #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 NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg); static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src); static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "/home/runner/work/Nim/Nim/temp.nim(3, 10) `d == 1` ", 51); N_LIB_PRIVATE NI d__pf9cOtOZdo9avHwQoaAaYeYA; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size))); } static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size) { nimCopyMem(dest, source, size); } static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) { { if (!!((src == ((NimStringDesc*) NIM_NIL)))) goto LA3_; copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1))))); (*dest).Sup.len += (*src).Sup.len; } LA3_: ; } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == ((TFrame*) NIM_NIL))) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) 2000))) goto LA8_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); { NimStringDesc* T5_; NimStringDesc* T6_; if (!!((((NI) (d__pf9cOtOZdo9avHwQoaAaYeYA)) == ((NI) 1)))) goto LA3_; T5_ = (NimStringDesc*)0; T6_ = (NimStringDesc*)0; T6_ = nimIntToStr(((NI) (d__pf9cOtOZdo9avHwQoaAaYeYA))); T5_ = rawNewString((T6_ ? T6_->Sup.len : 0) + 51); appendString(T5_, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); appendString(T5_, T6_); failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(T5_); } LA3_: ; popFrame(); } } ```

Stats

  • Started 2024-08-12T18:57:41
  • Finished 2024-08-12T18:57:41
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( newIdentNode("limited_int"), newEmptyNode(), nnkBracketExpr.newTree( newIdentNode("range"), nnkInfix.newTree( newIdentNode(".."), newLit(1), newLit(20) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("d"), newIdentNode("limited_int"), newEmptyNode() ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("d"), newLit(1) ), nnkPrefix.newTree( newIdentNode("$"), newIdentNode("d") ) ) ) ```
1.2.18 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-1.2.18/lib/system/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-1.2.18/lib/system/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-1.2.18/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(3, 10) `d == 1` 0 [AssertionError] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp ' ```

IR

Compiled filesize 91.53 Kb (93,728 bytes) ```cpp #define NIM_INTBITS 64 #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 NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg); static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src); static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x); N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space); static N_INLINE(void, initStackBottomWith)(void* locals); N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "/home/runner/work/Nim/Nim/temp.nim(3, 10) `d == 1` ", 51); N_LIB_PRIVATE NI d__pf9cOtOZdo9avHwQoaAaYeYA; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size))); } static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size) { nimCopyMem(dest, source, size); } static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) { { if (!!((src == NIM_NIL))) goto LA3_; copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1))))); (*dest).Sup.len += (*src).Sup.len; } LA3_: ; } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } static N_INLINE(void, nimFrame)(TFrame* s) { { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_; (*s).calldepth = ((NI16) 0); } goto LA1_; LA3_: ; { (*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)); } LA1_: ; (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA8_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA8_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } N_LIB_PRIVATE void PreMainInner(void) { } N_LIB_PRIVATE int cmdCount; N_LIB_PRIVATE char** cmdLine; N_LIB_PRIVATE char** gEnv; N_LIB_PRIVATE void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); { NimStringDesc* T5_; NimStringDesc* T6_; if (!!((((NI) (d__pf9cOtOZdo9avHwQoaAaYeYA)) == ((NI) 1)))) goto LA3_; T5_ = NIM_NIL; T6_ = NIM_NIL; T6_ = nimIntToStr(((NI) (d__pf9cOtOZdo9avHwQoaAaYeYA))); T5_ = rawNewString((T6_ ? T6_->Sup.len : 0) + 51); appendString(T5_, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); appendString(T5_, T6_); failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(T5_); } LA3_: ; popFrame(); } } ```

Stats

  • Started 2024-08-12T18:57:44
  • Finished 2024-08-12T18:57:44
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( newIdentNode("limited_int"), newEmptyNode(), nnkBracketExpr.newTree( newIdentNode("range"), nnkInfix.newTree( newIdentNode(".."), newLit(1), newLit(20) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("d"), newIdentNode("limited_int"), newEmptyNode() ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("d"), newLit(1) ), nnkPrefix.newTree( newIdentNode("$"), newIdentNode("d") ) ) ) ```
1.0.10 :-1: FAIL

Output

``` Error: Command failed: nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim /home/runner/work/Nim/Nim/temp.nim temp /home/runner/.choosenim/toolchains/nim-1.0.10/lib/system/assertions.nim failedAssertImpl /home/runner/.choosenim/toolchains/nim-1.0.10/lib/system/assertions.nim raiseAssert /home/runner/.choosenim/toolchains/nim-1.0.10/lib/system/fatal.nim sysFatal Error: unhandled exception: /home/runner/work/Nim/Nim/temp.nim(3, 10) `d == 1` 0 [AssertionError] Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp ' ```

IR

Compiled filesize 86.58 Kb (88,656 bytes) ```cpp #define NIM_INTBITS 64 #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 NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg); static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src); static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size); N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x); N_NIMCALL(NimStringDesc*, rawNewString)(NI space); static N_INLINE(void, initStackBottomWith)(void* locals); N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom); static N_INLINE(void, nimFrame)(TFrame* s); N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void); static N_INLINE(void, popFrame)(void); N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void); N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void); NI d__pf9cOtOZdo9avHwQoaAaYeYA; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_2, "/home/runner/work/Nim/Nim/temp.nim(3, 10) `d == 1` ", 51); static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_; T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size))); } static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size) { nimCopyMem(dest, source, size); } static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) { { if (!!((src == NIM_NIL))) goto LA3_; copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1))))); (*dest).Sup.len += (*src).Sup.len; } LA3_: ; } static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals); } static N_INLINE(void, nimFrame)(TFrame* s) { NI T1_; T1_ = (NI)0; { if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA4_; T1_ = ((NI) 0); } goto LA2_; LA4_: ; { T1_ = ((NI) ((NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1)))); } LA2_: ; (*s).calldepth = ((NI16) (T1_)); (*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw; framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s; { if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA9_; callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw(); } LA9_: ; } static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev; } void PreMainInner(void) { } int cmdCount; char** cmdLine; char** gEnv; void PreMain(void) { void (*volatile inner)(void); inner = PreMainInner; systemDatInit000(); initStackBottomWith((void *)&inner); systemInit000(); (*inner)(); } N_CDECL(void, NimMainInner)(void) { NimMainModule(); } N_CDECL(void, NimMain)(void) { void (*volatile inner)(void); PreMain(); inner = NimMainInner; initStackBottomWith((void *)&inner); (*inner)(); } int main(int argc, char** args, char** env) { cmdLine = args; cmdCount = argc; gEnv = env; NimMain(); return nim_program_result; } N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) { { nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim"); { NimStringDesc* T5_; NimStringDesc* T6_; if (!!((((NI) (d__pf9cOtOZdo9avHwQoaAaYeYA)) == ((NI) 1)))) goto LA3_; T5_ = (NimStringDesc*)0; T6_ = (NimStringDesc*)0; T6_ = nimIntToStr(((NI) (d__pf9cOtOZdo9avHwQoaAaYeYA))); T5_ = rawNewString((T6_ ? T6_->Sup.len : 0) + 51); appendString(T5_, ((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)); appendString(T5_, T6_); failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(T5_); } LA3_: ; popFrame(); } } ```

Stats

  • Started 2024-08-12T18:57:46
  • Finished 2024-08-12T18:57:46
  • Duration

AST

```nim nnkStmtList.newTree( nnkTypeSection.newTree( nnkTypeDef.newTree( newIdentNode("limited_int"), newEmptyNode(), nnkBracketExpr.newTree( newIdentNode("range"), nnkInfix.newTree( newIdentNode(".."), newLit(1), newLit(20) ) ) ) ), nnkVarSection.newTree( nnkIdentDefs.newTree( newIdentNode("d"), newIdentNode("limited_int"), newEmptyNode() ) ), nnkCommand.newTree( newIdentNode("doAssert"), nnkInfix.newTree( newIdentNode("=="), newIdentNode("d"), newLit(1) ), nnkPrefix.newTree( newIdentNode("$"), newIdentNode("d") ) ) ) ```
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 20.4
  • Created 2024-08-12T18:56:58Z
  • Comments 1
  • Commands nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim

:robot: Bug found in 25 minutes bisecting 8 commits at 0 commits per second