Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

SIGSEGV when slicing string or seq[T] with index out of range #22852

Closed
derekdai opened this issue Oct 21, 2023 · 8 comments · Fixed by #23279
Closed

SIGSEGV when slicing string or seq[T] with index out of range #22852

derekdai opened this issue Oct 21, 2023 · 8 comments · Fixed by #23279
Assignees

Comments

@derekdai
Copy link
Contributor

derekdai commented Oct 21, 2023

Description

Run following code + devel version of Nim compiler, it SIGSEGV instead of throwing RangeDefect

echo [0][2..^2]

Nim Version

devel

Current Output

SIGSEGV: Illegal storage access. (Attempt to read from nil?)

Expected Output

Error: unhandled exception: value out of range: -2 notin 0 .. 9223372036854775807 [RangeDefect]

Possible Solution

No response

Additional Information

ARC/ORC specific.

@ringabout
Copy link
Member

!nim c --gc:arc

echo [0][1..^1]

@github-actions
Copy link
Contributor

🐧 Linux bisect by @ringabout (member)
devel 👍 OK

Output

@[]

IR

Compiled filesize 94.21 Kb (96,472 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA {
 NI a;
 NI b;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___temp_u280)(tySequence__qwqHTkRvwhrRyENtudHQ7g x_p0);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___temp_u52)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a_p0, tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA x_p1);
static N_INLINE(tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA, dotdot___temp_u1)(NI a_p0, NI b_p1);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4219)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u169)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI)0)}
;
extern NIM_THREADVAR TFrame* framePtr__system_u3656;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4029;
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u3656 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u3656).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u3656;
 framePtr__system_u3656 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4219();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u3656 = (*framePtr__system_u3656).prev;
}
static N_INLINE(tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA, dotdot___temp_u1)(NI a_p0, NI b_p1) {
 tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-#devel/lib/system.nim");
 result.a = a_p0;
 result.b = b_p1;
 popFrame();
 return result;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (&nimInErrorMode__system_u4029);
 return result;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
 void (*volatile inner)(void);
 inner = PreMainInner;
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
 (*inner)();
#else
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
 PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
 NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
 void (*volatile inner)(void);
 PreMain();
 inner = NimMainInner;
 (*inner)();
#else
 PreMain();
 NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
 cmdLine = args;
 cmdCount = argc;
 gEnv = env;
 NimMain();
 return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA T3_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___temp_u1(((NI)1), ((NI)1));
 colontmpD_ = X5BX5D___temp_u52(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 colontmpD__2 = dollar___temp_u280(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(colontmpD__2.p);
}
  eqdestroy___temp_u169(colontmpD_);
 }
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T01:48:42
  • Finished 2023-10-23T01:48:43
  • Duration 1 minutes
stable 👍 OK

Output

@[]

IR

Compiled filesize 92.09 Kb (94,296 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ {
 NI a;
 NI b;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___temp_u297)(tySequence__qwqHTkRvwhrRyENtudHQ7g x_p0);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___temp_u52)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a_p0, tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ x_p1);
static N_INLINE(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ, dotdot___temp_u1)(NI a_p0, NI b_p1);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4159)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u185)(tySequence__qwqHTkRvwhrRyENtudHQ7g 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 NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI)0)}
;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3967;
extern NIM_THREADVAR TFrame* framePtr__system_u3605;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__system_u3967);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u3605 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u3605).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u3605;
 framePtr__system_u3605 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4159();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u3605 = (*framePtr__system_u3605).prev;
}
static N_INLINE(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ, dotdot___temp_u1)(NI a_p0, NI b_p1) {
 tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ));
 result.a = a_p0;
 result.b = b_p1;
 popFrame();
 return result;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
 void (*volatile inner)(void);
 inner = PreMainInner;
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
 (*inner)();
#else
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
 PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
 NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
 void (*volatile inner)(void);
 PreMain();
 inner = NimMainInner;
 (*inner)();
#else
 PreMain();
 NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
 cmdLine = args;
 cmdCount = argc;
 gEnv = env;
 NimMain();
 return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ T3_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___temp_u1(((NI)1), ((NI)1));
 colontmpD_ = X5BX5D___temp_u52(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 colontmpD__2 = dollar___temp_u297(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(colontmpD__2.p);
}
  eqdestroy___temp_u185(colontmpD_);
 }
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T01:48:43
  • Finished 2023-10-23T01:48:44
  • Duration
2.0.0 👍 OK

Output

@[]

IR

Compiled filesize 92.09 Kb (94,296 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ {
 NI a;
 NI b;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___temp_u297)(tySequence__qwqHTkRvwhrRyENtudHQ7g x_p0);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___temp_u52)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a_p0, tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ x_p1);
static N_INLINE(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ, dotdot___temp_u1)(NI a_p0, NI b_p1);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4159)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u185)(tySequence__qwqHTkRvwhrRyENtudHQ7g 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 NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI)0)}
;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3967;
extern NIM_THREADVAR TFrame* framePtr__system_u3605;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__system_u3967);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u3605 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u3605).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u3605;
 framePtr__system_u3605 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4159();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u3605 = (*framePtr__system_u3605).prev;
}
static N_INLINE(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ, dotdot___temp_u1)(NI a_p0, NI b_p1) {
 tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ));
 result.a = a_p0;
 result.b = b_p1;
 popFrame();
 return result;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
 void (*volatile inner)(void);
 inner = PreMainInner;
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
 (*inner)();
#else
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
 PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
 NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
 void (*volatile inner)(void);
 PreMain();
 inner = NimMainInner;
 (*inner)();
#else
 PreMain();
 NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
 cmdLine = args;
 cmdCount = argc;
 gEnv = env;
 NimMain();
 return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ T3_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___temp_u1(((NI)1), ((NI)1));
 colontmpD_ = X5BX5D___temp_u52(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 colontmpD__2 = dollar___temp_u297(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(colontmpD__2.p);
}
  eqdestroy___temp_u185(colontmpD_);
 }
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T01:48:44
  • Finished 2023-10-23T01:48:45
  • Duration
1.6.14 👍 OK

Output

@[]

IR

Compiled filesize 86.48 Kb (88,552 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#  define nimfr_(proc, file) \
 TFrame FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#  define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#  define nimln_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ {
NI a;
NI b;
};
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
 N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___temp_221)(tySequence__qwqHTkRvwhrRyENtudHQ7g x);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___temp_37)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a, tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ x);
static N_INLINE(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ, dotdot___temp_1)(NI a, NI b);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_4031)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_2997)(NimStringV2* dest);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_136)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI) 0)}
;
extern NIM_BOOL nimInErrorMode__system_3882;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__system_3882);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_7(p, ((int) 0), size);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s) {
 {
  if (!(framePtr__system_3557 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s).calldepth = ((NI16) 0);
 }
 goto LA1_;
 LA3_: ;
 {
  (*s).calldepth = (NI16)((*framePtr__system_3557).calldepth + ((NI16) 1));
 }
 LA1_: ;
 (*s).prev = framePtr__system_3557;
 framePtr__system_3557 = s;
 {
  if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
  callDepthLimitReached__system_4031();
 }
 LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_3557 = (*framePtr__system_3557).prev;
}
static N_INLINE(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ, dotdot___temp_1)(NI a, NI b) {
 tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-1.6.14/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ));
 result.a = a;
 result.b = b;
 popFrame();
 return result;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
 N_LIB_PRIVATE int cmdCount;
 N_LIB_PRIVATE char** cmdLine;
 N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000();
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_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) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ T3_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___temp_1(((NI) 1), ((NI) 1));
 colontmpD_ = X5BX5D___temp_37(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 colontmpD__2 = dollar___temp_221(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  eqdestroy___system_2997((&colontmpD__2));
  eqdestroy___temp_136((&colontmpD_));
 }
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T01:48:47
  • Finished 2023-10-23T01:48:48
  • Duration
1.4.8 👎 FAIL

Output

Error: Command failed: nim c --gc:arc -d:nimArcDebug -d:nimArcIds  --run  -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings: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/.choosenim/toolchains/nim-1.4.8/lib/system/bitmasks.nim(13, 3) Error: redefinition of 'PageShift'; previous declaration here: /home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/bitmasks.nim(13, 3)

IR

Compiled filesize 86.48 Kb (88,552 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#  define nimfr_(proc, file) \
 TFrame FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#  define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#  define nimln_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ {
NI a;
NI b;
};
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
 N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___temp_221)(tySequence__qwqHTkRvwhrRyENtudHQ7g x);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___temp_37)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a, tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ x);
static N_INLINE(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ, dotdot___temp_1)(NI a, NI b);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_4031)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_2997)(NimStringV2* dest);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_136)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI) 0)}
;
extern NIM_BOOL nimInErrorMode__system_3882;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__system_3882);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_7(p, ((int) 0), size);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s) {
 {
  if (!(framePtr__system_3557 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s).calldepth = ((NI16) 0);
 }
 goto LA1_;
 LA3_: ;
 {
  (*s).calldepth = (NI16)((*framePtr__system_3557).calldepth + ((NI16) 1));
 }
 LA1_: ;
 (*s).prev = framePtr__system_3557;
 framePtr__system_3557 = s;
 {
  if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
  callDepthLimitReached__system_4031();
 }
 LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_3557 = (*framePtr__system_3557).prev;
}
static N_INLINE(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ, dotdot___temp_1)(NI a, NI b) {
 tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-1.6.14/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ));
 result.a = a;
 result.b = b;
 popFrame();
 return result;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
 N_LIB_PRIVATE int cmdCount;
 N_LIB_PRIVATE char** cmdLine;
 N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000();
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_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) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ T3_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___temp_1(((NI) 1), ((NI) 1));
 colontmpD_ = X5BX5D___temp_37(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 colontmpD__2 = dollar___temp_221(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  eqdestroy___system_2997((&colontmpD__2));
  eqdestroy___temp_136((&colontmpD_));
 }
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T01:48:50
  • Finished 2023-10-23T01:48:50
  • Duration

AST

nnkStmtList.newTree(
  nnkCommand.newTree(
    newIdentNode("echo"),
    nnkBracketExpr.newTree(
      nnkBracket.newTree(
        newLit(0)
      ),
      nnkInfix.newTree(
        newIdentNode("..^"),
        newLit(1),
        newLit(1)
      )
    )
  )
)
1.2.18 👍 OK

Output

@[]

IR

Compiled filesize 83.00 Kb (84,992 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#  define nimfr_(proc, file) \
 TFrame FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#  define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#  define nimln_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA {
NI a;
NI b;
};
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
 N_LIB_PRIVATE N_NIMCALL(void, eqsink___aBBXmHFBEivKqERloP6zmA)(NimStringV2* dest, NimStringV2 src);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___Gsa4WPnABj84BVdJHxUK1w)(tySequence__qwqHTkRvwhrRyENtudHQ7g x);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___bzcjBFFzjz1bAdldi4TUbw)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest, tySequence__qwqHTkRvwhrRyENtudHQ7g src);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___qJXrS7bVhDbbO9bvCBXttlg)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x);
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem)(NI a, NI b);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NOINLINE(void, chckNil)(void* p);
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, echoBinSafe)(NimStringV2* args, NI argsLen_0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___dS1BF3Vxjg9aJMmmhVJKSpQ)(NimStringV2* dest);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___SAcH79b5ZePfUS16V9akl1gA)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI) 0)}
;
extern NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;
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, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
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;
}
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem)(NI a, NI b) {
 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
 chckNil((void*)(&result));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
 result.a = a;
 result.b = b;
 popFrame();
 return result;
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
 void (*volatile inner)(void);
 inner = PreMainInner;
 systemDatInit000();
 initStackBottomWith((void *)&inner);
 systemInit000();
 (*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
 NimMainModule();
}
N_CDECL(void, NimMain)(void) {
 void (*volatile inner)(void);
 PreMain();
 inner = NimMainInner;
 initStackBottomWith((void *)&inner);
 (*inner)();
}
int main(int argc, char** args, char** env) {
 cmdLine = args;
 cmdCount = argc;
 gEnv = env;
 NimMain();
 return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T3_;
 tySequence__qwqHTkRvwhrRyENtudHQ7g T4_;
 NimStringV2 T5_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem(((NI) 1), ((NI) 1));
 T4_.len = 0; T4_.p = NIM_NIL;
 T4_ = X5BX5D___qJXrS7bVhDbbO9bvCBXttlg(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 eqsink___bzcjBFFzjz1bAdldi4TUbw((&colontmpD_), T4_);
 T5_.len = 0; T5_.p = NIM_NIL;
 T5_ = dollar___Gsa4WPnABj84BVdJHxUK1w(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 eqsink___aBBXmHFBEivKqERloP6zmA((&colontmpD__2), T5_);
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  eqdestroy___dS1BF3Vxjg9aJMmmhVJKSpQ((&colontmpD__2));
  eqdestroy___SAcH79b5ZePfUS16V9akl1gA((&colontmpD_));
 }
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T01:48:53
  • Finished 2023-10-23T01:48:53
  • Duration
1.0.10 👎 FAIL

Output

Error: Command failed: nim c --gc:arc -d:nimArcDebug -d:nimArcIds  --run  -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
command line(1, 2) Error: 'none', 'boehm' or 'refc' expected, but 'arc' found

IR

Compiled filesize 83.00 Kb (84,992 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#  define nimfr_(proc, file) \
 TFrame FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#  define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#  define nimln_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA {
NI a;
NI b;
};
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
 N_LIB_PRIVATE N_NIMCALL(void, eqsink___aBBXmHFBEivKqERloP6zmA)(NimStringV2* dest, NimStringV2 src);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___Gsa4WPnABj84BVdJHxUK1w)(tySequence__qwqHTkRvwhrRyENtudHQ7g x);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___bzcjBFFzjz1bAdldi4TUbw)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest, tySequence__qwqHTkRvwhrRyENtudHQ7g src);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___qJXrS7bVhDbbO9bvCBXttlg)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x);
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem)(NI a, NI b);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NOINLINE(void, chckNil)(void* p);
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, echoBinSafe)(NimStringV2* args, NI argsLen_0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___dS1BF3Vxjg9aJMmmhVJKSpQ)(NimStringV2* dest);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___SAcH79b5ZePfUS16V9akl1gA)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI) 0)}
;
extern NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;
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, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
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;
}
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem)(NI a, NI b) {
 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
 chckNil((void*)(&result));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
 result.a = a;
 result.b = b;
 popFrame();
 return result;
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
 void (*volatile inner)(void);
 inner = PreMainInner;
 systemDatInit000();
 initStackBottomWith((void *)&inner);
 systemInit000();
 (*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
 NimMainModule();
}
N_CDECL(void, NimMain)(void) {
 void (*volatile inner)(void);
 PreMain();
 inner = NimMainInner;
 initStackBottomWith((void *)&inner);
 (*inner)();
}
int main(int argc, char** args, char** env) {
 cmdLine = args;
 cmdCount = argc;
 gEnv = env;
 NimMain();
 return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T3_;
 tySequence__qwqHTkRvwhrRyENtudHQ7g T4_;
 NimStringV2 T5_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem(((NI) 1), ((NI) 1));
 T4_.len = 0; T4_.p = NIM_NIL;
 T4_ = X5BX5D___qJXrS7bVhDbbO9bvCBXttlg(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 eqsink___bzcjBFFzjz1bAdldi4TUbw((&colontmpD_), T4_);
 T5_.len = 0; T5_.p = NIM_NIL;
 T5_ = dollar___Gsa4WPnABj84BVdJHxUK1w(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 eqsink___aBBXmHFBEivKqERloP6zmA((&colontmpD__2), T5_);
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  eqdestroy___dS1BF3Vxjg9aJMmmhVJKSpQ((&colontmpD__2));
  eqdestroy___SAcH79b5ZePfUS16V9akl1gA((&colontmpD_));
 }
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T01:48:55
  • Finished 2023-10-23T01:48:55
  • Duration

AST

nnkStmtList.newTree(
  nnkCommand.newTree(
    newIdentNode("echo"),
    nnkBracketExpr.newTree(
      nnkBracket.newTree(
        newLit(0)
      ),
      nnkInfix.newTree(
        newIdentNode("..^"),
        newLit(1),
        newLit(1)
      )
    )
  )
)
#a4f9bc55c ➡️ 🐛

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 18.2
  • Created 2023-10-23T01:48:08Z
  • Comments 1
  • Commands nim c --gc:arc -d:nimArcDebug -d:nimArcIds --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim

🤖 Bug found in 54 minutes bisecting 326 commits at 6 commits per second

@ringabout ringabout self-assigned this Oct 23, 2023
@ringabout
Copy link
Member

@derekdai Hi, I cannot reproduce the rangedefect with your example.

@derekdai
Copy link
Contributor Author

Sorry, it should be echo [0][2..^2], my bad.

@ringabout
Copy link
Member

!nim c --gc:arc

echo [0][2..^2]

@github-actions
Copy link
Contributor

🐧 Linux bisect by @ringabout (member)
devel 👎 FAIL

Output

Error: Command failed: nim c --gc:arc -d:nimArcDebug -d:nimArcIds  --run  -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
command line(1, 2) Warning: `gc:option` is deprecated; use `mm:option` instead [Deprecated]
Traceback (most recent call last)
/home/runner/work/Nim/Nim/temp.nim temp
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault (core dumped)
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 94.21 Kb (96,472 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA {
 NI a;
 NI b;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___temp_u280)(tySequence__qwqHTkRvwhrRyENtudHQ7g x_p0);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___temp_u52)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a_p0, tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA x_p1);
static N_INLINE(tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA, dotdot___temp_u1)(NI a_p0, NI b_p1);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4219)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u169)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI)0)}
;
extern NIM_THREADVAR TFrame* framePtr__system_u3656;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4029;
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u3656 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u3656).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u3656;
 framePtr__system_u3656 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4219();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u3656 = (*framePtr__system_u3656).prev;
}
static N_INLINE(tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA, dotdot___temp_u1)(NI a_p0, NI b_p1) {
 tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-#devel/lib/system.nim");
 result.a = a_p0;
 result.b = b_p1;
 popFrame();
 return result;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (&nimInErrorMode__system_u4029);
 return result;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
 void (*volatile inner)(void);
 inner = PreMainInner;
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
 (*inner)();
#else
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
 PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
 NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
 void (*volatile inner)(void);
 PreMain();
 inner = NimMainInner;
 (*inner)();
#else
 PreMain();
 NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
 cmdLine = args;
 cmdCount = argc;
 gEnv = env;
 NimMain();
 return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__vuwRJgdcPWbEO9cIdyL6bxA T3_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___temp_u1(((NI)2), ((NI)2));
 colontmpD_ = X5BX5D___temp_u52(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 colontmpD__2 = dollar___temp_u280(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(colontmpD__2.p);
}
  eqdestroy___temp_u169(colontmpD_);
 }
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T11:48:25
  • Finished 2023-10-23T11:48:26
  • Duration 1 minutes

AST

nnkStmtList.newTree(
  nnkCommand.newTree(
    newIdentNode("echo"),
    nnkBracketExpr.newTree(
      nnkBracket.newTree(
        newLit(0)
      ),
      nnkInfix.newTree(
        newIdentNode("..^"),
        newLit(2),
        newLit(2)
      )
    )
  )
)
stable 👎 FAIL

Output

Error: Command failed: nim c --gc:arc -d:nimArcDebug -d:nimArcIds  --run  -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
command line(1, 2) Warning: `gc:option` is deprecated; use `mm:option` instead [Deprecated]
/home/runner/work/Nim/Nim/temp.nim temp
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/indices.nim []
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/fatal.nim sysFatal
Error: unhandled exception: value out of range: -2 notin 0 .. 9223372036854775807 [RangeDefect]
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 92.09 Kb (94,296 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ {
 NI a;
 NI b;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___temp_u297)(tySequence__qwqHTkRvwhrRyENtudHQ7g x_p0);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___temp_u52)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a_p0, tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ x_p1);
static N_INLINE(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ, dotdot___temp_u1)(NI a_p0, NI b_p1);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4159)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u185)(tySequence__qwqHTkRvwhrRyENtudHQ7g 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 NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI)0)}
;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3967;
extern NIM_THREADVAR TFrame* framePtr__system_u3605;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__system_u3967);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u3605 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u3605).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u3605;
 framePtr__system_u3605 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4159();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u3605 = (*framePtr__system_u3605).prev;
}
static N_INLINE(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ, dotdot___temp_u1)(NI a_p0, NI b_p1) {
 tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ));
 result.a = a_p0;
 result.b = b_p1;
 popFrame();
 return result;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
 void (*volatile inner)(void);
 inner = PreMainInner;
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
 (*inner)();
#else
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
 PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
 NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
 void (*volatile inner)(void);
 PreMain();
 inner = NimMainInner;
 (*inner)();
#else
 PreMain();
 NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
 cmdLine = args;
 cmdCount = argc;
 gEnv = env;
 NimMain();
 return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ T3_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___temp_u1(((NI)2), ((NI)2));
 colontmpD_ = X5BX5D___temp_u52(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 colontmpD__2 = dollar___temp_u297(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(colontmpD__2.p);
}
  eqdestroy___temp_u185(colontmpD_);
 }
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T11:48:27
  • Finished 2023-10-23T11:48:28
  • Duration

AST

nnkStmtList.newTree(
  nnkCommand.newTree(
    newIdentNode("echo"),
    nnkBracketExpr.newTree(
      nnkBracket.newTree(
        newLit(0)
      ),
      nnkInfix.newTree(
        newIdentNode("..^"),
        newLit(2),
        newLit(2)
      )
    )
  )
)
2.0.0 👎 FAIL

Output

Error: Command failed: nim c --gc:arc -d:nimArcDebug -d:nimArcIds  --run  -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
command line(1, 2) Warning: `gc:option` is deprecated; use `mm:option` instead [Deprecated]
/home/runner/work/Nim/Nim/temp.nim temp
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/indices.nim []
/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system/fatal.nim sysFatal
Error: unhandled exception: value out of range: -2 notin 0 .. 9223372036854775807 [RangeDefect]
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 92.09 Kb (94,296 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ {
 NI a;
 NI b;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___temp_u297)(tySequence__qwqHTkRvwhrRyENtudHQ7g x_p0);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___temp_u52)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a_p0, tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ x_p1);
static N_INLINE(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ, dotdot___temp_u1)(NI a_p0, NI b_p1);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4159)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u185)(tySequence__qwqHTkRvwhrRyENtudHQ7g 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 NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI)0)}
;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3967;
extern NIM_THREADVAR TFrame* framePtr__system_u3605;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__system_u3967);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u3605 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u3605).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u3605;
 framePtr__system_u3605 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4159();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u3605 = (*framePtr__system_u3605).prev;
}
static N_INLINE(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ, dotdot___temp_u1)(NI a_p0, NI b_p1) {
 tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-2.0.0/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ));
 result.a = a_p0;
 result.b = b_p1;
 popFrame();
 return result;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
 void (*volatile inner)(void);
 inner = PreMainInner;
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
 (*inner)();
#else
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
 PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
 NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
 void (*volatile inner)(void);
 PreMain();
 inner = NimMainInner;
 (*inner)();
#else
 PreMain();
 NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
 cmdLine = args;
 cmdCount = argc;
 gEnv = env;
 NimMain();
 return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__radnDaA9aYYmhYW0ZEip9ctQ T3_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___temp_u1(((NI)2), ((NI)2));
 colontmpD_ = X5BX5D___temp_u52(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 colontmpD__2 = dollar___temp_u297(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(colontmpD__2.p);
}
  eqdestroy___temp_u185(colontmpD_);
 }
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T11:48:28
  • Finished 2023-10-23T11:48:29
  • Duration

AST

nnkStmtList.newTree(
  nnkCommand.newTree(
    newIdentNode("echo"),
    nnkBracketExpr.newTree(
      nnkBracket.newTree(
        newLit(0)
      ),
      nnkInfix.newTree(
        newIdentNode("..^"),
        newLit(2),
        newLit(2)
      )
    )
  )
)
1.6.14 👎 FAIL

Output

Error: Command failed: nim c --gc:arc -d:nimArcDebug -d:nimArcIds  --run  -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings: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.14/lib/system.nim []
/home/runner/.choosenim/toolchains/nim-1.6.14/lib/system/fatal.nim sysFatal
Error: unhandled exception: value out of range: -2 notin 0 .. 9223372036854775807 [RangeDefect]
Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp '
fatal.nim(54)            sysFatal
Error: unhandled exception: options.nim(645, 14) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 86.48 Kb (88,552 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#  define nimfr_(proc, file) \
 TFrame FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#  define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#  define nimln_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ {
NI a;
NI b;
};
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
 N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___temp_221)(tySequence__qwqHTkRvwhrRyENtudHQ7g x);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___temp_37)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a, tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ x);
static N_INLINE(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ, dotdot___temp_1)(NI a, NI b);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_4031)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_2997)(NimStringV2* dest);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_136)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI) 0)}
;
extern NIM_BOOL nimInErrorMode__system_3882;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__system_3882);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_7(p, ((int) 0), size);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s) {
 {
  if (!(framePtr__system_3557 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s).calldepth = ((NI16) 0);
 }
 goto LA1_;
 LA3_: ;
 {
  (*s).calldepth = (NI16)((*framePtr__system_3557).calldepth + ((NI16) 1));
 }
 LA1_: ;
 (*s).prev = framePtr__system_3557;
 framePtr__system_3557 = s;
 {
  if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
  callDepthLimitReached__system_4031();
 }
 LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_3557 = (*framePtr__system_3557).prev;
}
static N_INLINE(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ, dotdot___temp_1)(NI a, NI b) {
 tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-1.6.14/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ));
 result.a = a;
 result.b = b;
 popFrame();
 return result;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
 N_LIB_PRIVATE int cmdCount;
 N_LIB_PRIVATE char** cmdLine;
 N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000();
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_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) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ T3_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___temp_1(((NI) 2), ((NI) 2));
 colontmpD_ = X5BX5D___temp_37(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 colontmpD__2 = dollar___temp_221(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  eqdestroy___system_2997((&colontmpD__2));
  eqdestroy___temp_136((&colontmpD_));
 }
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T11:48:33
  • Finished 2023-10-23T11:48:33
  • Duration

AST

nnkStmtList.newTree(
  nnkCommand.newTree(
    newIdentNode("echo"),
    nnkBracketExpr.newTree(
      nnkBracket.newTree(
        newLit(0)
      ),
      nnkInfix.newTree(
        newIdentNode("..^"),
        newLit(2),
        newLit(2)
      )
    )
  )
)
1.4.8 👎 FAIL

Output

Error: Command failed: nim c --gc:arc -d:nimArcDebug -d:nimArcIds  --run  -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings: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/.choosenim/toolchains/nim-1.4.8/lib/system/bitmasks.nim(13, 3) Error: redefinition of 'PageShift'; previous declaration here: /home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/bitmasks.nim(13, 3)

IR

Compiled filesize 86.48 Kb (88,552 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#  define nimfr_(proc, file) \
 TFrame FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#  define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#  define nimln_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ {
NI a;
NI b;
};
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
 N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___temp_221)(tySequence__qwqHTkRvwhrRyENtudHQ7g x);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___temp_37)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a, tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ x);
static N_INLINE(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ, dotdot___temp_1)(NI a, NI b);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_4031)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args, NI argsLen_0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_2997)(NimStringV2* dest);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_136)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI) 0)}
;
extern NIM_BOOL nimInErrorMode__system_3882;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
extern TFrame* framePtr__system_3557;
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__system_3882);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_7(p, ((int) 0), size);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s) {
 {
  if (!(framePtr__system_3557 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s).calldepth = ((NI16) 0);
 }
 goto LA1_;
 LA3_: ;
 {
  (*s).calldepth = (NI16)((*framePtr__system_3557).calldepth + ((NI16) 1));
 }
 LA1_: ;
 (*s).prev = framePtr__system_3557;
 framePtr__system_3557 = s;
 {
  if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
  callDepthLimitReached__system_4031();
 }
 LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_3557 = (*framePtr__system_3557).prev;
}
static N_INLINE(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ, dotdot___temp_1)(NI a, NI b) {
 tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-1.6.14/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ));
 result.a = a;
 result.b = b;
 popFrame();
 return result;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
 N_LIB_PRIVATE int cmdCount;
 N_LIB_PRIVATE char** cmdLine;
 N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000();
 atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_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) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__ZwT1AdT5SpvzfXpu31YpBQ T3_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___temp_1(((NI) 2), ((NI) 2));
 colontmpD_ = X5BX5D___temp_37(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 colontmpD__2 = dollar___temp_221(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  eqdestroy___system_2997((&colontmpD__2));
  eqdestroy___temp_136((&colontmpD_));
 }
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T11:48:37
  • Finished 2023-10-23T11:48:37
  • Duration

AST

nnkStmtList.newTree(
  nnkCommand.newTree(
    newIdentNode("echo"),
    nnkBracketExpr.newTree(
      nnkBracket.newTree(
        newLit(0)
      ),
      nnkInfix.newTree(
        newIdentNode("..^"),
        newLit(2),
        newLit(2)
      )
    )
  )
)
1.2.18 👎 FAIL

Output

Error: Command failed: nim c --gc:arc -d:nimArcDebug -d:nimArcIds  --run  -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings: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.nim []
/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system/fatal.nim sysFatal
Error: unhandled exception: value out of range: -2 notin 0 .. 9223372036854775807 [RangeError]
Error: execution of an external program failed: '/home/runner/work/Nim/Nim/temp '

IR

Compiled filesize 83.00 Kb (84,992 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#  define nimfr_(proc, file) \
 TFrame FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#  define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#  define nimln_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA {
NI a;
NI b;
};
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
 N_LIB_PRIVATE N_NIMCALL(void, eqsink___aBBXmHFBEivKqERloP6zmA)(NimStringV2* dest, NimStringV2 src);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___Gsa4WPnABj84BVdJHxUK1w)(tySequence__qwqHTkRvwhrRyENtudHQ7g x);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___bzcjBFFzjz1bAdldi4TUbw)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest, tySequence__qwqHTkRvwhrRyENtudHQ7g src);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___qJXrS7bVhDbbO9bvCBXttlg)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x);
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem)(NI a, NI b);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NOINLINE(void, chckNil)(void* p);
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, echoBinSafe)(NimStringV2* args, NI argsLen_0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___dS1BF3Vxjg9aJMmmhVJKSpQ)(NimStringV2* dest);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___SAcH79b5ZePfUS16V9akl1gA)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI) 0)}
;
extern NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;
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, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
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;
}
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem)(NI a, NI b) {
 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
 chckNil((void*)(&result));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
 result.a = a;
 result.b = b;
 popFrame();
 return result;
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
 void (*volatile inner)(void);
 inner = PreMainInner;
 systemDatInit000();
 initStackBottomWith((void *)&inner);
 systemInit000();
 (*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
 NimMainModule();
}
N_CDECL(void, NimMain)(void) {
 void (*volatile inner)(void);
 PreMain();
 inner = NimMainInner;
 initStackBottomWith((void *)&inner);
 (*inner)();
}
int main(int argc, char** args, char** env) {
 cmdLine = args;
 cmdCount = argc;
 gEnv = env;
 NimMain();
 return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T3_;
 tySequence__qwqHTkRvwhrRyENtudHQ7g T4_;
 NimStringV2 T5_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem(((NI) 2), ((NI) 2));
 T4_.len = 0; T4_.p = NIM_NIL;
 T4_ = X5BX5D___qJXrS7bVhDbbO9bvCBXttlg(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 eqsink___bzcjBFFzjz1bAdldi4TUbw((&colontmpD_), T4_);
 T5_.len = 0; T5_.p = NIM_NIL;
 T5_ = dollar___Gsa4WPnABj84BVdJHxUK1w(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 eqsink___aBBXmHFBEivKqERloP6zmA((&colontmpD__2), T5_);
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  eqdestroy___dS1BF3Vxjg9aJMmmhVJKSpQ((&colontmpD__2));
  eqdestroy___SAcH79b5ZePfUS16V9akl1gA((&colontmpD_));
 }
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T11:48:39
  • Finished 2023-10-23T11:48:40
  • Duration

AST

nnkStmtList.newTree(
  nnkCommand.newTree(
    newIdentNode("echo"),
    nnkBracketExpr.newTree(
      nnkBracket.newTree(
        newLit(0)
      ),
      nnkInfix.newTree(
        newIdentNode("..^"),
        newLit(2),
        newLit(2)
      )
    )
  )
)
1.0.10 👎 FAIL

Output

Error: Command failed: nim c --gc:arc -d:nimArcDebug -d:nimArcIds  --run  -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
command line(1, 2) Error: 'none', 'boehm' or 'refc' expected, but 'arc' found

IR

Compiled filesize 83.00 Kb (84,992 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#  define nimfr_(proc, file) \
 TFrame FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#  define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#  define nimln_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
typedef NI tyArray__GAcaPw08Gj9cXYhAaMMr9cfw[1];
struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA {
NI a;
NI b;
};
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
#ifndef tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
#define tySequence__qwqHTkRvwhrRyENtudHQ7g_Content_PP
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE];};
#endif
 N_LIB_PRIVATE N_NIMCALL(void, eqsink___aBBXmHFBEivKqERloP6zmA)(NimStringV2* dest, NimStringV2 src);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___Gsa4WPnABj84BVdJHxUK1w)(tySequence__qwqHTkRvwhrRyENtudHQ7g x);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___bzcjBFFzjz1bAdldi4TUbw)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest, tySequence__qwqHTkRvwhrRyENtudHQ7g src);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g, X5BX5D___qJXrS7bVhDbbO9bvCBXttlg)(tyArray__GAcaPw08Gj9cXYhAaMMr9cfw a, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x);
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem)(NI a, NI b);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NOINLINE(void, chckNil)(void* p);
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, echoBinSafe)(NimStringV2* args, NI argsLen_0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___dS1BF3Vxjg9aJMmmhVJKSpQ)(NimStringV2* dest);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___SAcH79b5ZePfUS16V9akl1gA)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static NIM_CONST tyArray__GAcaPw08Gj9cXYhAaMMr9cfw TM__SRd76hP9cMfCzdUO857UhQQ_2 = {((NI) 0)}
;
extern NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;
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, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (NIM_BOOL*)0;
 result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
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;
}
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem)(NI a, NI b) {
 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA result;
 nimfr_("..", "/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system.nim");
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
 chckNil((void*)(&result));
 nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
 result.a = a;
 result.b = b;
 popFrame();
 return result;
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
 void (*volatile inner)(void);
 inner = PreMainInner;
 systemDatInit000();
 initStackBottomWith((void *)&inner);
 systemInit000();
 (*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
 NimMainModule();
}
N_CDECL(void, NimMain)(void) {
 void (*volatile inner)(void);
 PreMain();
 inner = NimMainInner;
 initStackBottomWith((void *)&inner);
 (*inner)();
}
int main(int argc, char** args, char** env) {
 cmdLine = args;
 cmdCount = argc;
 gEnv = env;
 NimMain();
 return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
 tySequence__qwqHTkRvwhrRyENtudHQ7g colontmpD_;
 NimStringV2 colontmpD__2;
 tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
 tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T3_;
 tySequence__qwqHTkRvwhrRyENtudHQ7g T4_;
 NimStringV2 T5_;
NIM_BOOL* nimErr_;
 nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
 colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
 colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
 T3_ = dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem(((NI) 2), ((NI) 2));
 T4_.len = 0; T4_.p = NIM_NIL;
 T4_ = X5BX5D___qJXrS7bVhDbbO9bvCBXttlg(TM__SRd76hP9cMfCzdUO857UhQQ_2, T3_);
 eqsink___bzcjBFFzjz1bAdldi4TUbw((&colontmpD_), T4_);
 T5_.len = 0; T5_.p = NIM_NIL;
 T5_ = dollar___Gsa4WPnABj84BVdJHxUK1w(colontmpD_);
 if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
 eqsink___aBBXmHFBEivKqERloP6zmA((&colontmpD__2), T5_);
 T2_[0] = colontmpD__2;
 echoBinSafe(T2_, 1);
 {
  LA1_:;
 }
 {
  eqdestroy___dS1BF3Vxjg9aJMmmhVJKSpQ((&colontmpD__2));
  eqdestroy___SAcH79b5ZePfUS16V9akl1gA((&colontmpD_));
 }
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2023-10-23T11:48:42
  • Finished 2023-10-23T11:48:42
  • Duration

AST

nnkStmtList.newTree(
  nnkCommand.newTree(
    newIdentNode("echo"),
    nnkBracketExpr.newTree(
      nnkBracket.newTree(
        newLit(0)
      ),
      nnkInfix.newTree(
        newIdentNode("..^"),
        newLit(2),
        newLit(2)
      )
    )
  )
)
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 18.2
  • Created 2023-10-23T11:47:51Z
  • Comments 5
  • Commands nim c --gc:arc -d:nimArcDebug -d:nimArcIds --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim

🤖 Bug found in 20 minutes bisecting 7 commits at 0 commits per second

@derekdai
Copy link
Contributor Author

@ringabout The latest bisect results are as expected. However, the devel version terminates with SIGSEGV instead of RangeDefect, which is the issue reported in this issue.

@ringabout
Copy link
Member

ringabout commented Feb 2, 2024

I have investigated the case using git bisect. It seems that 8f5b90f was the cause

@ringabout ringabout reopened this Feb 5, 2024
Araq pushed a commit that referenced this issue Apr 18, 2024
Araq pushed a commit that referenced this issue May 27, 2024
… or seq[T] with index out of range (#23279)

follow up #23013

fixes #22852
fixes #23435
fixes #23645

reports rangeDefect correctly

```nim
/workspaces/Nim/test9.nim(1) test9
/workspaces/Nim/lib/system/indices.nim(116) []
/workspaces/Nim/lib/system/fatal.nim(53) sysFatal
Error: unhandled exception: value out of range: -2 notin 0 .. 9223372036854775807 [RangeDefect]
```
narimiran pushed a commit that referenced this issue Sep 13, 2024
… or seq[T] with index out of range (#23279)

follow up #23013

fixes #22852
fixes #23435
fixes #23645

reports rangeDefect correctly

```nim
/workspaces/Nim/test9.nim(1) test9
/workspaces/Nim/lib/system/indices.nim(116) []
/workspaces/Nim/lib/system/fatal.nim(53) sysFatal
Error: unhandled exception: value out of range: -2 notin 0 .. 9223372036854775807 [RangeDefect]
```

(cherry picked from commit c615828)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants