-
-
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
C compiler error when default initializing an object field function when the default function is overloaded #23545
Comments
!nim c proc evaluate*(params: int) =
discard
proc evaluate*() =
discard
type SearchInfo = object
evaluation: proc() = evaluate
var a = SearchInfo() |
@tsoj Hi, I cannot reprocude the example listed |
🐧 Linux bisect by @ringabout (member)devel 👍 OKOutput
IRCompiled filesize93.10 Kb (95,336 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 tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA;
typedef struct tyObject_RefHeader__YmUax3FsG7Gnj3DF0PcAlw tyObject_RefHeader__YmUax3FsG7Gnj3DF0PcAlw;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (void* ClE_0);
void* ClE_0;
} tyProc__HzVCwACFYM9cx9aV62PdjtuA;
struct tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA {
tyProc__HzVCwACFYM9cx9aV62PdjtuA evaluation;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_RefHeader__YmUax3FsG7Gnj3DF0PcAlw {
NI rc;
NI rootIdx;
};
struct TNimTypeV2 {
void* destructor;
NI size;
NI16 align;
NI16 depth;
NU32* display;
void* traceImpl;
void* typeInfoV1;
NI flags;
void* vTable[SEQ_DECL_SIZE];
};
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);
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4548)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0);
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0);
static N_INLINE(NI, minuspercent___system_u803)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NOINLINE(void, rememberCycle__system_u3449)(NIM_BOOL isDestroyAction_p0, tyObject_RefHeader__YmUax3FsG7Gnj3DF0PcAlw* s_p1, TNimTypeV2* desc_p2);
N_LIB_PRIVATE N_NIMCALL(void, nimDestroyAndDispose)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
N_LIB_PRIVATE tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA a__temp_u7;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4332;
extern NIM_THREADVAR TFrame* framePtr__system_u2647;
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 = (&nimInErrorMode__system_u4332);
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_u2647 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u2647).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u2647;
framePtr__system_u2647 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4548();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u2647 = (*framePtr__system_u2647).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void) {
nimfr_("evaluate", "/home/runner/work/Nim/Nim/temp.nim");
popFrame();
}
static N_INLINE(NI, minuspercent___system_u803)(NI x_p0, NI y_p1) {
NI result;
nimfr_("-%", "/home/runner/.choosenim/toolchains/nim-#devel/lib/system/arithmetics.nim");
result = ((NI) ((NU)((NU64)(((NU) (x_p0))) - (NU64)(((NU) (y_p1))))));
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0) {
NIM_BOOL result;
NIM_BOOL* nimErr_;
nimfr_("nimDecRefIsLastCyclicDyn", "/home/runner/.choosenim/toolchains/nim-#devel/lib/system/orc.nim");
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
{
tyObject_RefHeader__YmUax3FsG7Gnj3DF0PcAlw* cell;
NI T5_;
if (!!((p_p0 == NIM_NIL))) goto LA3_;
T5_ = (NI)0;
T5_ = minuspercent___system_u803(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
cell = ((tyObject_RefHeader__YmUax3FsG7Gnj3DF0PcAlw*) (T5_));
{
if (!((NI)((*cell).rc & ((NI)-16)) == ((NI)0))) goto LA8_;
result = NIM_TRUE;
}
goto LA6_;
LA8_: ;
{
NI TM__SRd76hP9cMfCzdUO857UhQQ_2;
if (nimSubInt((*cell).rc, ((NI)16), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;
};
(*cell).rc = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2);
}
LA6_: ;
rememberCycle__system_u3449(result, cell, (*((TNimTypeV2**) (p_p0))));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA3_: ;
}BeforeRet_: ;
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0) {
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = nimDecRefIsLastCyclicDyn((*dest_p0).evaluation.ClE_0);
if (!T3_) goto LA4_;
nimDestroyAndDispose((*dest_p0).evaluation.ClE_0);
}
LA4_: ;
}
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) {
{
tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ colontmpD_;
tyProc__HzVCwACFYM9cx9aV62PdjtuA T1_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
colontmpD_ = (tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ)0;
nimZeroMem((void*)(&a__temp_u7), sizeof(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA));
colontmpD_ = evaluate__temp_u3;
nimZeroMem((void*)(&T1_), sizeof(tyProc__HzVCwACFYM9cx9aV62PdjtuA));
T1_.ClP_0 = colontmpD_; T1_.ClE_0 = NIM_NIL;
a__temp_u7.evaluation.ClE_0 = T1_.ClE_0;
a__temp_u7.evaluation.ClP_0 = T1_.ClP_0;
eqdestroy___temp_u11((&a__temp_u7));
nimTestErrorFlag();
popFrame();
}
} Stats
stable 👍 OKOutput
IRCompiled filesize90.92 Kb (93,104 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 tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA;
typedef struct tyObject_RefHeader__bT6rHCap81aoFk2UwTCpIw tyObject_RefHeader__bT6rHCap81aoFk2UwTCpIw;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (void* ClE_0);
void* ClE_0;
} tyProc__HzVCwACFYM9cx9aV62PdjtuA;
struct tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA {
tyProc__HzVCwACFYM9cx9aV62PdjtuA evaluation;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_RefHeader__bT6rHCap81aoFk2UwTCpIw {
NI rc;
NI rootIdx;
};
struct TNimTypeV2 {
void* destructor;
NI size;
NI16 align;
NI16 depth;
NU32* display;
void* traceImpl;
void* typeInfoV1;
NI flags;
};
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);
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4621)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0);
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0);
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NOINLINE(void, rememberCycle__system_u3417)(NIM_BOOL isDestroyAction_p0, tyObject_RefHeader__bT6rHCap81aoFk2UwTCpIw* s_p1, TNimTypeV2* desc_p2);
N_LIB_PRIVATE N_NIMCALL(void, nimDestroyAndDispose)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
N_LIB_PRIVATE tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA a__temp_u7;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4403;
extern NIM_THREADVAR TFrame* framePtr__system_u4020;
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 = (&nimInErrorMode__system_u4403);
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_u4020 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u4020).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u4020;
framePtr__system_u4020 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4621();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u4020 = (*framePtr__system_u4020).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void) {
nimfr_("evaluate", "/home/runner/work/Nim/Nim/temp.nim");
popFrame();
}
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1) {
NI result;
nimfr_("-%", "/home/runner/.choosenim/toolchains/nim-2.0.4/lib/system/arithmetics.nim");
result = ((NI) ((NU)((NU64)(((NU) (x_p0))) - (NU64)(((NU) (y_p1))))));
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0) {
NIM_BOOL result;
NIM_BOOL* nimErr_;
nimfr_("nimDecRefIsLastCyclicDyn", "/home/runner/.choosenim/toolchains/nim-2.0.4/lib/system/orc.nim");
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
{
tyObject_RefHeader__bT6rHCap81aoFk2UwTCpIw* cell;
NI T5_;
if (!!((p_p0 == NIM_NIL))) goto LA3_;
T5_ = (NI)0;
T5_ = minuspercent___system_u810(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
cell = ((tyObject_RefHeader__bT6rHCap81aoFk2UwTCpIw*) (T5_));
{
if (!((NI)((*cell).rc & ((NI)-16)) == ((NI)0))) goto LA8_;
result = NIM_TRUE;
}
goto LA6_;
LA8_: ;
{
NI TM__SRd76hP9cMfCzdUO857UhQQ_2;
if (nimSubInt((*cell).rc, ((NI)16), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;
};
(*cell).rc = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2);
}
LA6_: ;
rememberCycle__system_u3417(result, cell, (*((TNimTypeV2**) (p_p0))));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA3_: ;
}BeforeRet_: ;
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0) {
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = nimDecRefIsLastCyclicDyn((*dest_p0).evaluation.ClE_0);
if (!T3_) goto LA4_;
nimDestroyAndDispose((*dest_p0).evaluation.ClE_0);
}
LA4_: ;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot4atslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ colontmpD_;
tyProc__HzVCwACFYM9cx9aV62PdjtuA T1_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
colontmpD_ = (tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ)0;
nimZeroMem((void*)(&a__temp_u7), sizeof(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA));
colontmpD_ = evaluate__temp_u3;
nimZeroMem((void*)(&T1_), sizeof(tyProc__HzVCwACFYM9cx9aV62PdjtuA));
T1_.ClP_0 = colontmpD_; T1_.ClE_0 = NIM_NIL;
a__temp_u7.evaluation.ClE_0 = T1_.ClE_0;
a__temp_u7.evaluation.ClP_0 = T1_.ClP_0;
eqdestroy___temp_u11((&a__temp_u7));
nimTestErrorFlag();
popFrame();
}
} Stats
2.0.2 👍 OKOutput
IRCompiled filesize90.93 Kb (93,112 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 tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA;
typedef struct tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (void* ClE_0);
void* ClE_0;
} tyProc__HzVCwACFYM9cx9aV62PdjtuA;
struct tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA {
tyProc__HzVCwACFYM9cx9aV62PdjtuA evaluation;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low {
NI rc;
NI rootIdx;
};
struct TNimTypeV2 {
void* destructor;
NI size;
NI16 align;
NI16 depth;
NU32* display;
void* traceImpl;
void* typeInfoV1;
NI flags;
};
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);
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4621)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0);
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0);
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NOINLINE(void, rememberCycle__system_u3417)(NIM_BOOL isDestroyAction_p0, tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low* s_p1, TNimTypeV2* desc_p2);
N_LIB_PRIVATE N_NIMCALL(void, nimDestroyAndDispose)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
N_LIB_PRIVATE tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA a__temp_u7;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4403;
extern NIM_THREADVAR TFrame* framePtr__system_u4020;
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 = (&nimInErrorMode__system_u4403);
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_u4020 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u4020).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u4020;
framePtr__system_u4020 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4621();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u4020 = (*framePtr__system_u4020).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void) {
nimfr_("evaluate", "/home/runner/work/Nim/Nim/temp.nim");
popFrame();
}
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1) {
NI result;
nimfr_("-%", "/home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/arithmetics.nim");
result = ((NI) ((NU)((NU64)(((NU) (x_p0))) - (NU64)(((NU) (y_p1))))));
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0) {
NIM_BOOL result;
NIM_BOOL* nimErr_;
nimfr_("nimDecRefIsLastCyclicDyn", "/home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/orc.nim");
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
{
tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low* cell;
NI T5_;
if (!!((p_p0 == NIM_NIL))) goto LA3_;
T5_ = (NI)0;
T5_ = minuspercent___system_u810(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
cell = ((tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low*) (T5_));
{
if (!((NI)((*cell).rc & ((NI)-16)) == ((NI)0))) goto LA8_;
result = NIM_TRUE;
}
goto LA6_;
LA8_: ;
{
NI TM__SRd76hP9cMfCzdUO857UhQQ_2;
if (nimSubInt((*cell).rc, ((NI)16), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;
};
(*cell).rc = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2);
}
LA6_: ;
rememberCycle__system_u3417(result, cell, (*((TNimTypeV2**) (p_p0))));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA3_: ;
}BeforeRet_: ;
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0) {
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = nimDecRefIsLastCyclicDyn((*dest_p0).evaluation.ClE_0);
if (!T3_) goto LA4_;
nimDestroyAndDispose((*dest_p0).evaluation.ClE_0);
}
LA4_: ;
}
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;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_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) {
{
tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ colontmpD_;
tyProc__HzVCwACFYM9cx9aV62PdjtuA T1_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
colontmpD_ = (tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ)0;
nimZeroMem((void*)(&a__temp_u7), sizeof(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA));
colontmpD_ = evaluate__temp_u3;
nimZeroMem((void*)(&T1_), sizeof(tyProc__HzVCwACFYM9cx9aV62PdjtuA));
T1_.ClP_0 = colontmpD_; T1_.ClE_0 = NIM_NIL;
a__temp_u7.evaluation.ClE_0 = T1_.ClE_0;
a__temp_u7.evaluation.ClP_0 = T1_.ClP_0;
eqdestroy___temp_u11((&a__temp_u7));
nimTestErrorFlag();
popFrame();
}
} Stats
1.6.14 👎 FAILOutput
IRCompiled filesize90.93 Kb (93,112 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 tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA;
typedef struct tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (void* ClE_0);
void* ClE_0;
} tyProc__HzVCwACFYM9cx9aV62PdjtuA;
struct tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA {
tyProc__HzVCwACFYM9cx9aV62PdjtuA evaluation;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low {
NI rc;
NI rootIdx;
};
struct TNimTypeV2 {
void* destructor;
NI size;
NI16 align;
NI16 depth;
NU32* display;
void* traceImpl;
void* typeInfoV1;
NI flags;
};
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);
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4621)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0);
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0);
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NOINLINE(void, rememberCycle__system_u3417)(NIM_BOOL isDestroyAction_p0, tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low* s_p1, TNimTypeV2* desc_p2);
N_LIB_PRIVATE N_NIMCALL(void, nimDestroyAndDispose)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
N_LIB_PRIVATE tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA a__temp_u7;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4403;
extern NIM_THREADVAR TFrame* framePtr__system_u4020;
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 = (&nimInErrorMode__system_u4403);
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_u4020 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u4020).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u4020;
framePtr__system_u4020 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4621();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u4020 = (*framePtr__system_u4020).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void) {
nimfr_("evaluate", "/home/runner/work/Nim/Nim/temp.nim");
popFrame();
}
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1) {
NI result;
nimfr_("-%", "/home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/arithmetics.nim");
result = ((NI) ((NU)((NU64)(((NU) (x_p0))) - (NU64)(((NU) (y_p1))))));
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0) {
NIM_BOOL result;
NIM_BOOL* nimErr_;
nimfr_("nimDecRefIsLastCyclicDyn", "/home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/orc.nim");
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
{
tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low* cell;
NI T5_;
if (!!((p_p0 == NIM_NIL))) goto LA3_;
T5_ = (NI)0;
T5_ = minuspercent___system_u810(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
cell = ((tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low*) (T5_));
{
if (!((NI)((*cell).rc & ((NI)-16)) == ((NI)0))) goto LA8_;
result = NIM_TRUE;
}
goto LA6_;
LA8_: ;
{
NI TM__SRd76hP9cMfCzdUO857UhQQ_2;
if (nimSubInt((*cell).rc, ((NI)16), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;
};
(*cell).rc = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2);
}
LA6_: ;
rememberCycle__system_u3417(result, cell, (*((TNimTypeV2**) (p_p0))));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA3_: ;
}BeforeRet_: ;
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0) {
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = nimDecRefIsLastCyclicDyn((*dest_p0).evaluation.ClE_0);
if (!T3_) goto LA4_;
nimDestroyAndDispose((*dest_p0).evaluation.ClE_0);
}
LA4_: ;
}
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;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_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) {
{
tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ colontmpD_;
tyProc__HzVCwACFYM9cx9aV62PdjtuA T1_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
colontmpD_ = (tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ)0;
nimZeroMem((void*)(&a__temp_u7), sizeof(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA));
colontmpD_ = evaluate__temp_u3;
nimZeroMem((void*)(&T1_), sizeof(tyProc__HzVCwACFYM9cx9aV62PdjtuA));
T1_.ClP_0 = colontmpD_; T1_.ClE_0 = NIM_NIL;
a__temp_u7.evaluation.ClE_0 = T1_.ClE_0;
a__temp_u7.evaluation.ClP_0 = T1_.ClP_0;
eqdestroy___temp_u11((&a__temp_u7));
nimTestErrorFlag();
popFrame();
}
} Stats
ASTnnkStmtList.newTree(
nnkProcDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("evaluate")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("params"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("evaluate")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("SearchInfo"),
newEmptyNode(),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("evaluation"),
nnkProcTy.newTree(
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode()
),
newIdentNode("evaluate")
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("SearchInfo")
)
)
)
) 1.4.8 👎 FAILOutput
IRCompiled filesize90.93 Kb (93,112 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 tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA;
typedef struct tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (void* ClE_0);
void* ClE_0;
} tyProc__HzVCwACFYM9cx9aV62PdjtuA;
struct tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA {
tyProc__HzVCwACFYM9cx9aV62PdjtuA evaluation;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low {
NI rc;
NI rootIdx;
};
struct TNimTypeV2 {
void* destructor;
NI size;
NI16 align;
NI16 depth;
NU32* display;
void* traceImpl;
void* typeInfoV1;
NI flags;
};
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);
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4621)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0);
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0);
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NOINLINE(void, rememberCycle__system_u3417)(NIM_BOOL isDestroyAction_p0, tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low* s_p1, TNimTypeV2* desc_p2);
N_LIB_PRIVATE N_NIMCALL(void, nimDestroyAndDispose)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
N_LIB_PRIVATE tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA a__temp_u7;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4403;
extern NIM_THREADVAR TFrame* framePtr__system_u4020;
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 = (&nimInErrorMode__system_u4403);
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_u4020 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u4020).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u4020;
framePtr__system_u4020 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4621();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u4020 = (*framePtr__system_u4020).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void) {
nimfr_("evaluate", "/home/runner/work/Nim/Nim/temp.nim");
popFrame();
}
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1) {
NI result;
nimfr_("-%", "/home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/arithmetics.nim");
result = ((NI) ((NU)((NU64)(((NU) (x_p0))) - (NU64)(((NU) (y_p1))))));
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0) {
NIM_BOOL result;
NIM_BOOL* nimErr_;
nimfr_("nimDecRefIsLastCyclicDyn", "/home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/orc.nim");
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
{
tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low* cell;
NI T5_;
if (!!((p_p0 == NIM_NIL))) goto LA3_;
T5_ = (NI)0;
T5_ = minuspercent___system_u810(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
cell = ((tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low*) (T5_));
{
if (!((NI)((*cell).rc & ((NI)-16)) == ((NI)0))) goto LA8_;
result = NIM_TRUE;
}
goto LA6_;
LA8_: ;
{
NI TM__SRd76hP9cMfCzdUO857UhQQ_2;
if (nimSubInt((*cell).rc, ((NI)16), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;
};
(*cell).rc = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2);
}
LA6_: ;
rememberCycle__system_u3417(result, cell, (*((TNimTypeV2**) (p_p0))));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA3_: ;
}BeforeRet_: ;
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0) {
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = nimDecRefIsLastCyclicDyn((*dest_p0).evaluation.ClE_0);
if (!T3_) goto LA4_;
nimDestroyAndDispose((*dest_p0).evaluation.ClE_0);
}
LA4_: ;
}
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;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_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) {
{
tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ colontmpD_;
tyProc__HzVCwACFYM9cx9aV62PdjtuA T1_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
colontmpD_ = (tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ)0;
nimZeroMem((void*)(&a__temp_u7), sizeof(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA));
colontmpD_ = evaluate__temp_u3;
nimZeroMem((void*)(&T1_), sizeof(tyProc__HzVCwACFYM9cx9aV62PdjtuA));
T1_.ClP_0 = colontmpD_; T1_.ClE_0 = NIM_NIL;
a__temp_u7.evaluation.ClE_0 = T1_.ClE_0;
a__temp_u7.evaluation.ClP_0 = T1_.ClP_0;
eqdestroy___temp_u11((&a__temp_u7));
nimTestErrorFlag();
popFrame();
}
} Stats
ASTnnkStmtList.newTree(
nnkProcDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("evaluate")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("params"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("evaluate")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("SearchInfo"),
newEmptyNode(),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("evaluation"),
nnkProcTy.newTree(
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode()
),
newIdentNode("evaluate")
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("SearchInfo")
)
)
)
) 1.2.18 👎 FAILOutput
IRCompiled filesize90.93 Kb (93,112 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 tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA;
typedef struct tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (void* ClE_0);
void* ClE_0;
} tyProc__HzVCwACFYM9cx9aV62PdjtuA;
struct tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA {
tyProc__HzVCwACFYM9cx9aV62PdjtuA evaluation;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low {
NI rc;
NI rootIdx;
};
struct TNimTypeV2 {
void* destructor;
NI size;
NI16 align;
NI16 depth;
NU32* display;
void* traceImpl;
void* typeInfoV1;
NI flags;
};
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);
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4621)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0);
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0);
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NOINLINE(void, rememberCycle__system_u3417)(NIM_BOOL isDestroyAction_p0, tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low* s_p1, TNimTypeV2* desc_p2);
N_LIB_PRIVATE N_NIMCALL(void, nimDestroyAndDispose)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
N_LIB_PRIVATE tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA a__temp_u7;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4403;
extern NIM_THREADVAR TFrame* framePtr__system_u4020;
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 = (&nimInErrorMode__system_u4403);
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_u4020 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u4020).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u4020;
framePtr__system_u4020 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4621();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u4020 = (*framePtr__system_u4020).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void) {
nimfr_("evaluate", "/home/runner/work/Nim/Nim/temp.nim");
popFrame();
}
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1) {
NI result;
nimfr_("-%", "/home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/arithmetics.nim");
result = ((NI) ((NU)((NU64)(((NU) (x_p0))) - (NU64)(((NU) (y_p1))))));
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0) {
NIM_BOOL result;
NIM_BOOL* nimErr_;
nimfr_("nimDecRefIsLastCyclicDyn", "/home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/orc.nim");
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
{
tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low* cell;
NI T5_;
if (!!((p_p0 == NIM_NIL))) goto LA3_;
T5_ = (NI)0;
T5_ = minuspercent___system_u810(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
cell = ((tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low*) (T5_));
{
if (!((NI)((*cell).rc & ((NI)-16)) == ((NI)0))) goto LA8_;
result = NIM_TRUE;
}
goto LA6_;
LA8_: ;
{
NI TM__SRd76hP9cMfCzdUO857UhQQ_2;
if (nimSubInt((*cell).rc, ((NI)16), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;
};
(*cell).rc = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2);
}
LA6_: ;
rememberCycle__system_u3417(result, cell, (*((TNimTypeV2**) (p_p0))));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA3_: ;
}BeforeRet_: ;
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0) {
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = nimDecRefIsLastCyclicDyn((*dest_p0).evaluation.ClE_0);
if (!T3_) goto LA4_;
nimDestroyAndDispose((*dest_p0).evaluation.ClE_0);
}
LA4_: ;
}
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;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_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) {
{
tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ colontmpD_;
tyProc__HzVCwACFYM9cx9aV62PdjtuA T1_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
colontmpD_ = (tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ)0;
nimZeroMem((void*)(&a__temp_u7), sizeof(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA));
colontmpD_ = evaluate__temp_u3;
nimZeroMem((void*)(&T1_), sizeof(tyProc__HzVCwACFYM9cx9aV62PdjtuA));
T1_.ClP_0 = colontmpD_; T1_.ClE_0 = NIM_NIL;
a__temp_u7.evaluation.ClE_0 = T1_.ClE_0;
a__temp_u7.evaluation.ClP_0 = T1_.ClP_0;
eqdestroy___temp_u11((&a__temp_u7));
nimTestErrorFlag();
popFrame();
}
} Stats
ASTnnkStmtList.newTree(
nnkProcDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("evaluate")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("params"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("evaluate")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("SearchInfo"),
newEmptyNode(),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("evaluation"),
nnkProcTy.newTree(
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode()
),
newIdentNode("evaluate")
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("SearchInfo")
)
)
)
) 1.0.10 👎 FAILOutput
IRCompiled filesize90.93 Kb (93,112 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 tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA;
typedef struct tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (void* ClE_0);
void* ClE_0;
} tyProc__HzVCwACFYM9cx9aV62PdjtuA;
struct tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA {
tyProc__HzVCwACFYM9cx9aV62PdjtuA evaluation;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low {
NI rc;
NI rootIdx;
};
struct TNimTypeV2 {
void* destructor;
NI size;
NI16 align;
NI16 depth;
NU32* display;
void* traceImpl;
void* typeInfoV1;
NI flags;
};
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);
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4621)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0);
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0);
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NOINLINE(void, rememberCycle__system_u3417)(NIM_BOOL isDestroyAction_p0, tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low* s_p1, TNimTypeV2* desc_p2);
N_LIB_PRIVATE N_NIMCALL(void, nimDestroyAndDispose)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
N_LIB_PRIVATE tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA a__temp_u7;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4403;
extern NIM_THREADVAR TFrame* framePtr__system_u4020;
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 = (&nimInErrorMode__system_u4403);
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_u4020 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u4020).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u4020;
framePtr__system_u4020 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4621();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u4020 = (*framePtr__system_u4020).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, evaluate__temp_u3)(void) {
nimfr_("evaluate", "/home/runner/work/Nim/Nim/temp.nim");
popFrame();
}
static N_INLINE(NI, minuspercent___system_u810)(NI x_p0, NI y_p1) {
NI result;
nimfr_("-%", "/home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/arithmetics.nim");
result = ((NI) ((NU)((NU64)(((NU) (x_p0))) - (NU64)(((NU) (y_p1))))));
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0) {
NIM_BOOL result;
NIM_BOOL* nimErr_;
nimfr_("nimDecRefIsLastCyclicDyn", "/home/runner/.choosenim/toolchains/nim-2.0.2/lib/system/orc.nim");
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
{
tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low* cell;
NI T5_;
if (!!((p_p0 == NIM_NIL))) goto LA3_;
T5_ = (NI)0;
T5_ = minuspercent___system_u810(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
cell = ((tyObject_RefHeader__i9cpogTuqvijClQ9bxER2Low*) (T5_));
{
if (!((NI)((*cell).rc & ((NI)-16)) == ((NI)0))) goto LA8_;
result = NIM_TRUE;
}
goto LA6_;
LA8_: ;
{
NI TM__SRd76hP9cMfCzdUO857UhQQ_2;
if (nimSubInt((*cell).rc, ((NI)16), &TM__SRd76hP9cMfCzdUO857UhQQ_2)) { raiseOverflow(); goto BeforeRet_;
};
(*cell).rc = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_2);
}
LA6_: ;
rememberCycle__system_u3417(result, cell, (*((TNimTypeV2**) (p_p0))));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA3_: ;
}BeforeRet_: ;
popFrame();
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u11)(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA* dest_p0) {
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = nimDecRefIsLastCyclicDyn((*dest_p0).evaluation.ClE_0);
if (!T3_) goto LA4_;
nimDestroyAndDispose((*dest_p0).evaluation.ClE_0);
}
LA4_: ;
}
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;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot2atslibatssystemdotnim_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) {
{
tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ colontmpD_;
tyProc__HzVCwACFYM9cx9aV62PdjtuA T1_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
colontmpD_ = (tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ)0;
nimZeroMem((void*)(&a__temp_u7), sizeof(tyObject_SearchInfo__8gEYRb5dURP8lhCYW1QILA));
colontmpD_ = evaluate__temp_u3;
nimZeroMem((void*)(&T1_), sizeof(tyProc__HzVCwACFYM9cx9aV62PdjtuA));
T1_.ClP_0 = colontmpD_; T1_.ClE_0 = NIM_NIL;
a__temp_u7.evaluation.ClE_0 = T1_.ClE_0;
a__temp_u7.evaluation.ClP_0 = T1_.ClP_0;
eqdestroy___temp_u11((&a__temp_u7));
nimTestErrorFlag();
popFrame();
}
} Stats
ASTnnkStmtList.newTree(
nnkProcDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("evaluate")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("params"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("evaluate")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("SearchInfo"),
newEmptyNode(),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("evaluation"),
nnkProcTy.newTree(
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode()
),
newIdentNode("evaluate")
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("SearchInfo")
)
)
)
) ??? ➡️ 🐛DiagnosticsThe commit that introduced the bug can not be found, but the bug is in the commits: (Can not find the commit because Nim can not be re-built commit-by-commit to bisect). Stats
🤖 Bug found in |
I use this C compiler: tsoj@tsoj-desktop /tmp> gcc --version
gcc (GCC) 14.0.1 20240411 (Red Hat 14.0.1-0)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. On Fedora 40. On Xubuntu 23.10 with this gcc version the bug doesn't appear: C:\tmp> gcc --version
gcc (Ubuntu 13.2.0-4ubuntu3) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
Also possibly related to #21801 |
See also https://forum.nim-lang.org/t/11587 |
Description
I get a C compiler error when trying to compile this code with
nim c main.nim
:Nim Version
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-04-27
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: f682dab
active boot switches: -d:release
Current Output
Expected Output
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: