-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Comments
!nim c --gc:arc echo [0][1..^1] |
🐧 Linux bisect by @ringabout (member)devel 👍 OKOutput
IRCompiled filesize94.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
stable 👍 OKOutput
IRCompiled filesize92.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
2.0.0 👍 OKOutput
IRCompiled filesize92.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
1.6.14 👍 OKOutput
IRCompiled filesize86.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
1.4.8 👎 FAILOutput
IRCompiled filesize86.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
ASTnnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkBracketExpr.newTree(
nnkBracket.newTree(
newLit(0)
),
nnkInfix.newTree(
newIdentNode("..^"),
newLit(1),
newLit(1)
)
)
)
) 1.2.18 👍 OKOutput
IRCompiled filesize83.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
1.0.10 👎 FAILOutput
IRCompiled filesize83.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
ASTnnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkBracketExpr.newTree(
nnkBracket.newTree(
newLit(0)
),
nnkInfix.newTree(
newIdentNode("..^"),
newLit(1),
newLit(1)
)
)
)
) #a4f9bc55c ➡️ 🐛Diagnosticscooldome introduced a bug at
The bug is in the files:
The bug can be in the commits:
(Diagnostics sometimes off-by-one). Stats
🤖 Bug found in |
@derekdai Hi, I cannot reproduce the rangedefect with your example. |
Sorry, it should be |
!nim c --gc:arc echo [0][2..^2] |
🐧 Linux bisect by @ringabout (member)devel 👎 FAILOutput
IRCompiled filesize94.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
ASTnnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkBracketExpr.newTree(
nnkBracket.newTree(
newLit(0)
),
nnkInfix.newTree(
newIdentNode("..^"),
newLit(2),
newLit(2)
)
)
)
) stable 👎 FAILOutput
IRCompiled filesize92.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
ASTnnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkBracketExpr.newTree(
nnkBracket.newTree(
newLit(0)
),
nnkInfix.newTree(
newIdentNode("..^"),
newLit(2),
newLit(2)
)
)
)
) 2.0.0 👎 FAILOutput
IRCompiled filesize92.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
ASTnnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkBracketExpr.newTree(
nnkBracket.newTree(
newLit(0)
),
nnkInfix.newTree(
newIdentNode("..^"),
newLit(2),
newLit(2)
)
)
)
) 1.6.14 👎 FAILOutput
IRCompiled filesize86.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
ASTnnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkBracketExpr.newTree(
nnkBracket.newTree(
newLit(0)
),
nnkInfix.newTree(
newIdentNode("..^"),
newLit(2),
newLit(2)
)
)
)
) 1.4.8 👎 FAILOutput
IRCompiled filesize86.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
ASTnnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkBracketExpr.newTree(
nnkBracket.newTree(
newLit(0)
),
nnkInfix.newTree(
newIdentNode("..^"),
newLit(2),
newLit(2)
)
)
)
) 1.2.18 👎 FAILOutput
IRCompiled filesize83.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
ASTnnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkBracketExpr.newTree(
nnkBracket.newTree(
newLit(0)
),
nnkInfix.newTree(
newIdentNode("..^"),
newLit(2),
newLit(2)
)
)
)
) 1.0.10 👎 FAILOutput
IRCompiled filesize83.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
ASTnnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkBracketExpr.newTree(
nnkBracket.newTree(
newLit(0)
),
nnkInfix.newTree(
newIdentNode("..^"),
newLit(2),
newLit(2)
)
)
)
) Stats
🤖 Bug found in |
@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. |
I have investigated the case using |
… 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] ```
… 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)
Description
Run following code + devel version of Nim compiler, it SIGSEGV instead of throwing
RangeDefect
Nim Version
devel
Current Output
Expected Output
Possible Solution
No response
Additional Information
ARC/ORC specific.
The text was updated successfully, but these errors were encountered: