Closed nitely closed 1 month ago
!nim c
import std/algorithm
func rev(s: var string) =
s.reverse
proc main =
var abc = "abc"
abc.rev
echo abc
main()
91.23 Kb (93,416 bytes)
```cpp
#include "nimbase.h"
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimln_(n) \
FR_.line = n;
#define nimlf_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, reverse__temp_u4)(NIM_CHAR* a_p0, NI a_p0Len_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4655)(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, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4437;
extern NIM_THREADVAR TFrame* framePtr__system_u2669;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u4437);
return result;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u2669 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u2669).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u2669;
framePtr__system_u2669 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4655();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u2669 = (*framePtr__system_u2669).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__temp_u4(((*s_p0).p) ? ((*s_p0).p->data) : NIM_NIL, (*s_p0).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__temp_u2((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
if (abc.p && !(abc.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(abc.p);
}
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__temp_u31();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T00:54:35
2024-09-19T00:54:36
93.45 Kb (95,688 bytes)
```cpp
#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 NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, reverse__temp_u4)(NIM_CHAR* a_p0, NI a_p0Len_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4620)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4402;
extern NIM_THREADVAR TFrame* framePtr__system_u4059;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u4402);
return result;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u4059 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u4059).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u4059;
framePtr__system_u4059 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4620();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u4059 = (*framePtr__system_u4059).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__temp_u4(((*s_p0).p) ? ((*s_p0).p->data) : NIM_NIL, (*s_p0).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__temp_u2((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
if (abc.p && !(abc.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(abc.p);
}
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__temp_u31();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T00:54:39
2024-09-19T00:54:40
93.45 Kb (95,688 bytes)
```cpp
#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 NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, reverse__temp_u4)(NIM_CHAR* a_p0, NI a_p0Len_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4620)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4402;
extern NIM_THREADVAR TFrame* framePtr__system_u4059;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u4402);
return result;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u4059 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u4059).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u4059;
framePtr__system_u4059 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4620();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u4059 = (*framePtr__system_u4059).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__temp_u4(((*s_p0).p) ? ((*s_p0).p->data) : NIM_NIL, (*s_p0).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__temp_u2((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
if (abc.p && !(abc.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(abc.p);
}
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__temp_u31();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T00:54:40
2024-09-19T00:54:41
91.31 Kb (93,504 bytes)
```cpp
#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 NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, reverse__temp_u4)(NIM_CHAR* a_p0, NI a_p0Len_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4607)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4389;
extern NIM_THREADVAR TFrame* framePtr__system_u4006;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__system_u4389);
return result;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u4006 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u4006).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u4006;
framePtr__system_u4006 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4607();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u4006 = (*framePtr__system_u4006).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__temp_u4(((*s_p0).p) ? ((*s_p0).p->data) : NIM_NIL, (*s_p0).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__temp_u2((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
if (abc.p && !(abc.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(abc.p);
}
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__temp_u31();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T00:54:44
2024-09-19T00:54:45
96.28 Kb (98,592 bytes)
```cpp
#include "nimbase.h"
#include 2024-09-19T00:54:47
2024-09-19T00:54:48
96.83 Kb (99,152 bytes)
```cpp
#include "nimbase.h"
#include 2024-09-19T00:54:49
2024-09-19T00:54:50
92.55 Kb (94,776 bytes)
```cpp
#include "nimbase.h"
#include 2024-09-19T00:54:52
2024-09-19T00:54:52
91.66 Kb (93,856 bytes)
```cpp
#include "nimbase.h"
#include 2024-09-19T00:54:54
2024-09-19T00:54:54
2022-09-23 19:05:05 +0800
on commit #7739e2342 with message:
```
defaults to ORC (#19972)
* defaults to Orc
* bootstrap using refc
* use gc
* init orc defines
* unregister orc
* fix gc
* fix commands
* add prepareMutation for orc
* enable deepcopy for orc
* prepareMutation
* more fixes
* some cases
* bug #20081
* partial fixes
* partial fixes
* fixes command line
* more fixes
* build Nim with refc
* use gc
* more fixes
* rstore
* orc doesn't support threadpool
* more shallowCopy
* more fixes
* fixes unsafeNew
* workarounds
* small
* more fixes
* fixes some megatest
* tcodegenbugs1 refc
* fxies megatest
* build nimble with refc
* workaround tensordsl tests
* replace shallowCopy with move
* fixes action
* workaround
* add todo
* fixes important packages
* unpublic unregisterArcOrc
* fixes cpp
* enable windows
Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
```
The bug is in the files:
```
.github/workflows/ci_docs.yml
compiler/commands.nim
compiler/nim.nim
compiler/options.nim
koch.nim
lib/system/iterators.nim
nimsuggest/sexp.nim
testament/categories.nim
testament/important_packages.nim
tests/assign/moverload_asgn2.nim
tests/async/tasync_traceback.nim
tests/ccgbugs/t13062.nim
tests/ccgbugs/tassign_nil_strings.nim
tests/ccgbugs/tcodegenbug1.nim
tests/ccgbugs/tdeepcopy_addr_rval.nim
tests/ccgbugs/thtiobj.nim
tests/ccgbugs/tmissinginit.nim
tests/ccgbugs/tmissingvolatile.nim
tests/collections/tseq.nim
tests/concepts/t3330.nim
tests/concepts/tusertypeclasses.nim
tests/destructor/tatomicptrs.nim
tests/errmsgs/t10376.nim
tests/exception/tcpp_imported_exc.nim
tests/generics/tgeneric3.nim
tests/generics/tparam_binding.nim
tests/gensym/tgensymgeneric.nim
tests/ic/config.nims
tests/iter/tshallowcopy_closures.nim
tests/macros/tstaticparamsmacro.nim
tests/magics/t10307.nim
tests/magics/tmagics.nim
tests/manyloc/keineschweine/keineschweine.nim.cfg
tests/manyloc/keineschweine/lib/estreams.nim
tests/metatype/tmetatype_various.nim
tests/metatype/tstaticparammacro.nim
tests/metatype/tstaticvector.nim
tests/misc/taddr.nim
tests/misc/tnew.nim
tests/misc/trunner_special.nim
tests/misc/tunsignedconv.nim
tests/modules/tmodule_name_clashes.nim
tests/niminaction/Chapter3/various3.nim
tests/objects/t4318.nim
tests/objects/tobj_asgn_dont_slice.nim
tests/objects/tobjconstr.nim
tests/parallel/tconvexhull.nim
tests/parallel/tdeepcopy.nim
tests/parallel/tdeepcopy2.nim
tests/parallel/tdisjoint_slice1.nim
tests/parallel/tflowvar.nim
tests/parallel/tinvalid_array_bounds.nim
tests/parallel/tmissing_deepcopy.nim
tests/parallel/tnon_disjoint_slice1.nim
tests/parallel/tparfind.nim
tests/parallel/tpi.nim
tests/parallel/tsendtwice.nim
tests/parallel/tsysspawn.nim
tests/parallel/tuseafterdef.nim
tests/parallel/twaitany.nim
tests/parser/t12274.nim
tests/pragmas/t12640.nim
tests/pragmas/tnoreturn.nim
tests/stdlib/mgenast.nim
tests/stdlib/tgenast.nim
tests/stdlib/thttpclient_ssl.nim
tests/stdlib/tjson.nim
tests/stdlib/tmitems.nim
tests/stdlib/tstdlib_various.nim
tests/stdlib/tstring.nim
tests/stdlib/twchartoutf8.nim
tests/system/tdeepcopy.nim
tests/template/twrongmapit.nim
tests/threads/tjsthreads.nim
tests/threads/tonthreadcreation.nim
tests/typerel/t4799_1.nim
tests/typerel/t4799_2.nim
tests/typerel/t4799_3.nim
tests/typerel/ttypedesc_as_genericparam1.nim
tests/typerel/ttypedesc_as_genericparam1_orc.nim
tests/typerel/ttypedesc_as_genericparam2.nim
```
The bug can be in the commits:
(Diagnostics sometimes off-by-one).11.4.0
14.0.0
20.4
2024-09-19T00:54:07Z
1
nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
:robot: Bug found in 40 mins
bisecting 2494
commits at 61
commits per second
!nim c --gc:arc
import std/algorithm
func rev(s: var string) =
s.reverse
proc main =
var abc = "abc"
abc.rev
echo abc
main()
86.73 Kb (88,808 bytes)
```cpp
#include "nimbase.h"
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimln_(n) \
FR_.line = n;
#define nimlf_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, reverse__temp_u4)(NIM_CHAR* a_p0, NI a_p0Len_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4225)(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, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4033;
extern NIM_THREADVAR TFrame* framePtr__system_u2640;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u4033);
return result;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u2640 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u2640).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u2640;
framePtr__system_u2640 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4225();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u2640 = (*framePtr__system_u2640).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__temp_u4(((*s_p0).p) ? ((*s_p0).p->data) : NIM_NIL, (*s_p0).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__temp_u2((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
if (abc.p && !(abc.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(abc.p);
}
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__temp_u31();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T02:37:36
2024-09-19T02:37:36
88.84 Kb (90,976 bytes)
```cpp
#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 NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, reverse__temp_u4)(NIM_CHAR* a_p0, NI a_p0Len_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4170)(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, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3978;
extern NIM_THREADVAR TFrame* framePtr__system_u3653;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u3978);
return result;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u3653 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u3653).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u3653;
framePtr__system_u3653 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4170();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u3653 = (*framePtr__system_u3653).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__temp_u4(((*s_p0).p) ? ((*s_p0).p->data) : NIM_NIL, (*s_p0).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__temp_u2((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
if (abc.p && !(abc.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(abc.p);
}
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__temp_u31();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T02:37:40
2024-09-19T02:37:41
88.84 Kb (90,976 bytes)
```cpp
#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 NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, reverse__temp_u4)(NIM_CHAR* a_p0, NI a_p0Len_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4170)(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, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3978;
extern NIM_THREADVAR TFrame* framePtr__system_u3653;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u3978);
return result;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u3653 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u3653).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u3653;
framePtr__system_u3653 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4170();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u3653 = (*framePtr__system_u3653).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__temp_u4(((*s_p0).p) ? ((*s_p0).p->data) : NIM_NIL, (*s_p0).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__temp_u2((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
if (abc.p && !(abc.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(abc.p);
}
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot8atslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__temp_u31();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T02:37:41
2024-09-19T02:37:42
86.70 Kb (88,784 bytes)
```cpp
#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 NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, reverse__temp_u4)(NIM_CHAR* a_p0, NI a_p0Len_0);
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, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3967;
extern NIM_THREADVAR TFrame* framePtr__system_u3605;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__system_u3967);
return result;
}
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;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s_p0) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__temp_u4(((*s_p0).p) ? ((*s_p0).p->data) : NIM_NIL, (*s_p0).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u31)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__temp_u2((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
if (abc.p && !(abc.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(abc.p);
}
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__temp_u31();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T02:37:45
2024-09-19T02:37:45
81.50 Kb (83,456 bytes)
```cpp
#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, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u29)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s);
N_LIB_PRIVATE N_NIMCALL(void, reverse__temp_u4)(NIM_CHAR* a, NI aLen_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4055)(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_u3021)(NimStringV2* dest);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern NIM_BOOL nimInErrorMode__system_u3906;
extern TFrame* framePtr__system_u3581;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__system_u3906);
return result;
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__system_u3581 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__system_u3581).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__system_u3581;
framePtr__system_u3581 = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
callDepthLimitReached__system_u4055();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u3581 = (*framePtr__system_u3581).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__temp_u4(((*s).p) ? ((*s).p->data) : NIM_NIL, (*s).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u29)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__temp_u2((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
eqdestroy___system_u3021((&abc));
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000();
PreMainInner();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
PreMain();
NimMainInner();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__temp_u29();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T02:37:49
2024-09-19T02:37:50
81.50 Kb (83,456 bytes)
```cpp
#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, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u29)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s);
N_LIB_PRIVATE N_NIMCALL(void, reverse__temp_u4)(NIM_CHAR* a, NI aLen_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4055)(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_u3021)(NimStringV2* dest);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern NIM_BOOL nimInErrorMode__system_u3906;
extern TFrame* framePtr__system_u3581;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__system_u3906);
return result;
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__system_u3581 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__system_u3581).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__system_u3581;
framePtr__system_u3581 = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
callDepthLimitReached__system_u4055();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u3581 = (*framePtr__system_u3581).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__temp_u2)(NimStringV2* s) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__temp_u4(((*s).p) ? ((*s).p->data) : NIM_NIL, (*s).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__temp_u29)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__temp_u2((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
eqdestroy___system_u3021((&abc));
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000();
PreMainInner();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
PreMain();
NimMainInner();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__temp_u29();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T02:37:52
2024-09-19T02:37:52
73.83 Kb (75,600 bytes)
```cpp
#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, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__EzBZaa239as9bFx8yeHDoTOw)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__M33htTarT3MPij9aNZoCdAg)(NimStringV2* s);
N_LIB_PRIVATE N_NIMCALL(void, reverse__ZFWXZRLpsKFl2OzCm4rOZA)(NIM_CHAR* a, NI aLen_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
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, 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 const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
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(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
return result;
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_;
(*s).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA8_;
callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__M33htTarT3MPij9aNZoCdAg)(NimStringV2* s) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__ZFWXZRLpsKFl2OzCm4rOZA((*s).p->data, (*s).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__EzBZaa239as9bFx8yeHDoTOw)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__M33htTarT3MPij9aNZoCdAg((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
eqdestroy___dS1BF3Vxjg9aJMmmhVJKSpQ((&abc));
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
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) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__EzBZaa239as9bFx8yeHDoTOw();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T02:37:55
2024-09-19T02:37:56
73.83 Kb (75,600 bytes)
```cpp
#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, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
typedef NimStringV2 tyArray__nHXaesL0DJZHyVS07ARPRA[1];
N_LIB_PRIVATE N_NIMCALL(void, main__EzBZaa239as9bFx8yeHDoTOw)(void);
N_LIB_PRIVATE N_NIMCALL(void, rev__M33htTarT3MPij9aNZoCdAg)(NimStringV2* s);
N_LIB_PRIVATE N_NIMCALL(void, reverse__ZFWXZRLpsKFl2OzCm4rOZA)(NIM_CHAR* a, NI aLen_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
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, 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 const struct {
NI cap; NIM_CHAR data[3+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 3 | NIM_STRLIT_FLAG, "abc" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {3, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
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(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
return result;
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_;
(*s).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA8_;
callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rev__M33htTarT3MPij9aNZoCdAg)(NimStringV2* s) {
NIM_BOOL* nimErr_;
nimfr_("rev", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
reverse__ZFWXZRLpsKFl2OzCm4rOZA((*s).p->data, (*s).len);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, main__EzBZaa239as9bFx8yeHDoTOw)(void) {
NimStringV2 abc;
tyArray__nHXaesL0DJZHyVS07ARPRA T2_;
NIM_BOOL* nimErr_;
nimfr_("main", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
abc.len = 0; abc.p = NIM_NIL;
abc = TM__SRd76hP9cMfCzdUO857UhQQ_3;
rev__M33htTarT3MPij9aNZoCdAg((&abc));
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
T2_[0] = abc;
echoBinSafe(T2_, 1);
{
LA1_:;
}
{
eqdestroy___dS1BF3Vxjg9aJMmmhVJKSpQ((&abc));
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
popFrame();
}
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) {
{
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
main__EzBZaa239as9bFx8yeHDoTOw();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
}
```
2024-09-19T02:37:59
2024-09-19T02:37:59
11.4.0
14.0.0
20.4
2024-09-19T02:37:04Z
3
nim c --gc:arc -d:nimArcDebug -d:nimArcIds --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
:robot: Bug found in 25 mins
bisecting 8
commits at 0
commits per second
reverse
has a var openarray[T]
overload which matches as openarray[char]
for string
, but this means the compiler doesn't know to insert prepareMutation
. Maybe for conversions from string
to var openarray
it should always invoke prepareMutation
?
I thought the codegen would already do that, so yes, that's what it should do.
conversions from string to var openarray it should always invoke prepareMutation
It has already been done, but not var string
-> var openArray
If it's var string
already, why would it need prepareMutation
when passed to var openarray
?
prepareMutation
is not set up for var string
as the parameter. Only bracket expressions and openarray conversions use nimPrepareStrMutationV2
proc foo(x: var string) =
discard
var x = "123"
foo(x)
If it's var string already, why would it need prepareMutation when passed to var openarray?
proc foo(x: var openArray[char]) =
discard
var x = "123"
foo(x)
In this case, x is of type var string
. The backend skips the nkHiddenAddr for x
ad generates nimPrepareStrMutationV2
. But it doesn't handle the case for a skParam with a var string
type
proc bar(x: var openArray[char]) =
discard
proc foo(x: var string) =
bar(x)
var x = "123"
foo(x)
The culprit seems to be that transf
folds (addr (deref (param))
which is harmful to openArrayLoc
Description
The following code runs on refc, but sigsegv on orc:
Nim Version
Nim Compiler Version 2.1.99 [Linux: amd64] Compiled at 2024-09-18 Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 04ccd2f4f07a169a03db3cc6f9316628c03f214a active boot switches: -d:release
Current Output
Expected Output
No response
Known Workarounds
No response
Additional Information
No response