-
-
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
std/pegs
with nim cpp --mm:orc --exceptions:goto
creates invalid C++
#22101
Comments
!nim cpp --gc:arc import std/pegs
discard pegs.peg("") |
@juancarlospaco (contributor) devel :-1: FAILOutput
Stats
IR#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#include <exception>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
#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;
struct tyObject_Peg__eHZ39baPVS6Ex9aCbakMpOLA;
struct NimStrPayload;
struct NimStringV2;
struct tyObject_NonTerminalObj__YJQBzPMiCVZ9a9aFblGw9bz9aQ;
struct tySequence__FP9cpgC5P8HWlLP22NHEOaw;
struct tySequence__FP9cpgC5P8HWlLP22NHEOaw_Content;
struct Exception;
struct RootObj;
struct TNimTypeV2;
struct tySequence__9bNRJkU9cJnNkESCDTQ7DgcQ;
struct tySequence__9bNRJkU9cJnNkESCDTQ7DgcQ_Content;
struct tyObject_StackTraceEntry__2Xjg6E7TZG7p9bcgUNTKHrg;
typedef NU8 tyEnum_PegKind__8HD2K9c0ElHMxe2OEKoQqRg;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tySequence__FP9cpgC5P8HWlLP22NHEOaw {
NI len; tySequence__FP9cpgC5P8HWlLP22NHEOaw_Content* p;
};
struct tyObject_Peg__eHZ39baPVS6Ex9aCbakMpOLA {
tyEnum_PegKind__8HD2K9c0ElHMxe2OEKoQqRg kind;
union{
NimStringV2 term;
NIM_CHAR ch;
NU8* charChoice;
tyObject_NonTerminalObj__YJQBzPMiCVZ9a9aFblGw9bz9aQ* nt;
NI index;
tySequence__FP9cpgC5P8HWlLP22NHEOaw sons;
};
};
struct TNimTypeV2 {
void* destructor;
NI size;
NI16 align;
NI16 depth;
NU32* display;
void* traceImpl;
void* typeInfoV1;
NI flags;
};
struct RootObj {
TNimTypeV2* m_type;
};
struct tySequence__9bNRJkU9cJnNkESCDTQ7DgcQ {
NI len; tySequence__9bNRJkU9cJnNkESCDTQ7DgcQ_Content* p;
};
struct Exception : public RootObj {
Exception* parent;
NCSTRING name;
NimStringV2 message;
tySequence__9bNRJkU9cJnNkESCDTQ7DgcQ trace;
Exception* up;
};
struct tySequence__FP9cpgC5P8HWlLP22NHEOaw_Content { NI cap; tyObject_Peg__eHZ39baPVS6Ex9aCbakMpOLA data[SEQ_DECL_SIZE]; };
struct tyObject_StackTraceEntry__2Xjg6E7TZG7p9bcgUNTKHrg {
NCSTRING procname;
NI line;
NCSTRING filename;
};
struct tySequence__9bNRJkU9cJnNkESCDTQ7DgcQ_Content { NI cap; tyObject_StackTraceEntry__2Xjg6E7TZG7p9bcgUNTKHrg data[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);
N_LIB_PRIVATE N_NIMCALL(void, peg__pureZpegs_u4958)(NimStringV2 pattern_p0, tyObject_Peg__eHZ39baPVS6Ex9aCbakMpOLA* Result);
static N_INLINE(TFrame*, getFrame)(void);
static N_INLINE(void, setFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZpegs_u232)(tyObject_Peg__eHZ39baPVS6Ex9aCbakMpOLA& dest_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u3620)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystematsexceptionsdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatspureatspegsdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[0+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern TFrame* framePtr__system_u3100;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
void* T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
}
static N_INLINE(TFrame*, getFrame)(void) {
TFrame* result;
result = (TFrame*)0;
result = framePtr__system_u3100;
return result;
}
static N_INLINE(void, setFrame)(TFrame* s_p0) {
framePtr__system_u3100 = s_p0;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u3100 == ((TFrame*) NIM_NIL))) goto LA3_;
{ (*s_p0).calldepth = ((NI16)0);
} }
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u3100).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u3100;
framePtr__system_u3100 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
{ callDepthLimitReached__system_u3620();
} }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u3100 = (*framePtr__system_u3100).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystematsexceptionsdotnim_DatInit000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatspureatspegsdotnim_DatInit000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystematsexceptionsdotnim_DatInit000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatspureatspegsdotnim_DatInit000();
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) {
{
tyObject_Peg__eHZ39baPVS6Ex9aCbakMpOLA colontmpD_;
TFrame* _nimCurFrame;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
_nimCurFrame = getFrame();
nimZeroMem((void*)(&colontmpD_), sizeof(tyObject_Peg__eHZ39baPVS6Ex9aCbakMpOLA));
std::exception_ptr T2_;
try {
peg__pureZpegs_u4958(TM__SRd76hP9cMfCzdUO857UhQQ_3, (&colontmpD_));
(void)(colontmpD_);
}
catch (Exception* T3_) {
setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
catch (...) {
setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
{
eqdestroy___pureZpegs_u232(colontmpD_);
if (T2_) std::rethrow_exception(T2_);
}
popFrame();
}
} ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("pegs")
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("pegs"),
newIdentNode("peg")
),
newLit("")
)
)
) stable :-1: FAILOutput
Stats
IR#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#include <exception>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# 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;
struct tyObject_Peg__9bJDkQSmj1I1wfUxN9ago6Ng;
struct NimStrPayload;
struct NimStringV2;
struct tyObject_NonTerminalObj__bwEun9bfpvLl9c51oMJLaVgg;
struct tySequence__WKST2D9aCGgAJ583IpgK3Kw;
struct tySequence__WKST2D9aCGgAJ583IpgK3Kw_Content;
struct Exception;
struct RootObj;
struct TNimTypeV2;
struct tySequence__SeNI9cjAwgnSTUG8yHFeMew;
struct tySequence__SeNI9cjAwgnSTUG8yHFeMew_Content;
struct tyObject_StackTraceEntry__HK6FWWCL5W1d6sCawft2nw;
typedef NU8 tyEnum_PegKind__xa5Xl9a1Gk4UhGAzDuMAYPg;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tySequence__WKST2D9aCGgAJ583IpgK3Kw {
NI len; tySequence__WKST2D9aCGgAJ583IpgK3Kw_Content* p;
};
struct tyObject_Peg__9bJDkQSmj1I1wfUxN9ago6Ng {
tyEnum_PegKind__xa5Xl9a1Gk4UhGAzDuMAYPg kind;
union{
NimStringV2 term;
NIM_CHAR ch;
NU8* charChoice;
tyObject_NonTerminalObj__bwEun9bfpvLl9c51oMJLaVgg* nt;
NI index;
tySequence__WKST2D9aCGgAJ583IpgK3Kw sons;
};
};
struct TNimTypeV2 {
void* destructor;
NI size;
NI align;
NCSTRING name;
void* traceImpl;
void* typeInfoV1;
NI flags;
};
struct RootObj {
TNimTypeV2* m_type;
};
struct tySequence__SeNI9cjAwgnSTUG8yHFeMew {
NI len; tySequence__SeNI9cjAwgnSTUG8yHFeMew_Content* p;
};
struct Exception : public RootObj {
Exception* parent;
NCSTRING name;
NimStringV2 message;
tySequence__SeNI9cjAwgnSTUG8yHFeMew trace;
Exception* up;
};
#ifndef tySequence__WKST2D9aCGgAJ583IpgK3Kw_Content_PP
#define tySequence__WKST2D9aCGgAJ583IpgK3Kw_Content_PP
struct tySequence__WKST2D9aCGgAJ583IpgK3Kw_Content { NI cap; tyObject_Peg__9bJDkQSmj1I1wfUxN9ago6Ng data[SEQ_DECL_SIZE];};
#endif
struct tyObject_StackTraceEntry__HK6FWWCL5W1d6sCawft2nw {
NCSTRING procname;
NI line;
NCSTRING filename;
};
#ifndef tySequence__SeNI9cjAwgnSTUG8yHFeMew_Content_PP
#define tySequence__SeNI9cjAwgnSTUG8yHFeMew_Content_PP
struct tySequence__SeNI9cjAwgnSTUG8yHFeMew_Content { NI cap; tyObject_StackTraceEntry__HK6FWWCL5W1d6sCawft2nw data[SEQ_DECL_SIZE];};
#endif
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void, peg__pureZpegs_4359)(NimStringV2 pattern, tyObject_Peg__9bJDkQSmj1I1wfUxN9ago6Ng* Result);
static N_INLINE(TFrame*, getFrame)(void);
static N_INLINE(void, setFrame)(TFrame* s);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZpegs_178)(tyObject_Peg__9bJDkQSmj1I1wfUxN9ago6Ng& dest);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_3636)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatspureatspegsdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[0+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern TFrame* framePtr__system_3187;
extern TFrame* framePtr__system_3187;
extern TFrame* framePtr__system_3187;
extern TFrame* framePtr__system_3187;
extern TFrame* framePtr__system_3187;
extern TFrame* framePtr__system_3187;
extern TFrame* framePtr__system_3187;
extern TFrame* framePtr__system_3187;
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
void* T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem__systemZmemory_7(p, ((int) 0), size);
}
static N_INLINE(TFrame*, getFrame)(void) {
TFrame* result;
result = (TFrame*)0;
result = framePtr__system_3187;
return result;
}
static N_INLINE(void, setFrame)(TFrame* s) {
framePtr__system_3187 = s;
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__system_3187 == ((TFrame*) NIM_NIL))) goto LA3_;
{ (*s).calldepth = ((NI16) 0);
} }
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__system_3187).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__system_3187;
framePtr__system_3187 = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
{ callDepthLimitReached__system_3636();
} }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_3187 = (*framePtr__system_3187).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_DatInit000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatssystemdotnim_Init000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot14atslibatspureatspegsdotnim_DatInit000();
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) {
{
tyObject_Peg__9bJDkQSmj1I1wfUxN9ago6Ng colontmpD_;
TFrame* _nimCurFrame;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
std::exception_ptr T2_ = nullptr; _nimCurFrame = getFrame();
nimZeroMem((void*)(&colontmpD_), sizeof(tyObject_Peg__9bJDkQSmj1I1wfUxN9ago6Ng));
try {
peg__pureZpegs_4359(TM__SRd76hP9cMfCzdUO857UhQQ_3, (&colontmpD_));
(void)(colontmpD_);
}
catch (Exception* T3_) {
setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
catch (...) { setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
{
eqdestroy___pureZpegs_178(colontmpD_);
if (T2_) std::rethrow_exception(T2_);
}
popFrame();
}
} ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("pegs")
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("pegs"),
newIdentNode("peg")
),
newLit("")
)
)
) 1.6.0 :-1: FAILOutput
Stats
IR#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#include <exception>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# 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;
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ;
struct NimStrPayload;
struct NimStringV2;
struct tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA;
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g;
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content;
struct Exception;
struct RootObj;
struct TNimTypeV2;
struct tySequence__uB9b75OUPRENsBAu4AnoePA;
struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content;
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
typedef NU8 tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g {
NI len; tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content* p;
};
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ {
tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q kind;
union{
NimStringV2 term;
NIM_CHAR ch;
NU8* charChoice;
tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA* nt;
NI index;
tySequence__5DSB9bTgCQCsIApS5TVlG8g sons;
};
};
struct TNimTypeV2 {
void* destructor;
NI size;
NI align;
NCSTRING name;
void* traceImpl;
void* typeInfoV1;
NI flags;
};
struct RootObj {
TNimTypeV2* m_type;
};
struct tySequence__uB9b75OUPRENsBAu4AnoePA {
NI len; tySequence__uB9b75OUPRENsBAu4AnoePA_Content* p;
};
struct Exception : public RootObj {
Exception* parent;
NCSTRING name;
NimStringV2 message;
tySequence__uB9b75OUPRENsBAu4AnoePA trace;
Exception* up;
};
#ifndef tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content_PP
#define tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content_PP
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content { NI cap; tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ data[SEQ_DECL_SIZE];};
#endif
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
#ifndef tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
#define tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content { NI cap; tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];};
#endif
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem_systemZmemory_7)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void, peg_pureZpegs_4285)(NimStringV2 pattern, tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ* Result);
static N_INLINE(TFrame*, getFrame)(void);
static N_INLINE(void, setFrame)(TFrame* s);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy__pureZpegs_178)(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ& dest);
static N_INLINE(void, initStackBottomWith)(void* locals);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached_system_3580)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_pegsDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[0+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern TFrame* framePtr_system_3135;
extern TFrame* framePtr_system_3135;
extern TFrame* framePtr_system_3135;
extern TFrame* framePtr_system_3135;
extern TFrame* framePtr_system_3135;
extern TFrame* framePtr_system_3135;
extern TFrame* framePtr_system_3135;
extern TFrame* framePtr_system_3135;
static N_INLINE(void, nimSetMem_systemZmemory_7)(void* a, int v, NI size) {
void* T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem_systemZmemory_7(p, ((int) 0), size);
}
static N_INLINE(TFrame*, getFrame)(void) {
TFrame* result;
result = (TFrame*)0;
result = framePtr_system_3135;
return result;
}
static N_INLINE(void, setFrame)(TFrame* s) {
framePtr_system_3135 = s;
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr_system_3135 == ((TFrame*) NIM_NIL))) goto LA3_;
{ (*s).calldepth = ((NI16) 0);
} }
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr_system_3135).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr_system_3135;
framePtr_system_3135 = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
{ callDepthLimitReached_system_3580();
} }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr_system_3135 = (*framePtr_system_3135).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
systemInit000();
stdlib_pegsDatInit000();
(*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) {
{
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ colontmpD_;
TFrame* _nimCurFrame;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
std::exception_ptr T2_ = nullptr; _nimCurFrame = getFrame();
nimZeroMem((void*)(&colontmpD_), sizeof(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ));
try {
peg_pureZpegs_4285(TM__SRd76hP9cMfCzdUO857UhQQ_3, (&colontmpD_));
(void)(colontmpD_);
}
catch (Exception* T3_) {
setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
catch (...) { setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
{
eqdestroy__pureZpegs_178(colontmpD_);
if (T2_) std::rethrow_exception(T2_);
}
popFrame();
}
} ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("pegs")
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("pegs"),
newIdentNode("peg")
),
newLit("")
)
)
) 1.4.0 :-1: FAILOutput
Stats
IR
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#include <exception>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# 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;
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ;
struct NimStrPayload;
struct NimStringV2;
struct tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA;
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g;
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content;
struct Exception;
struct RootObj;
struct TNimTypeV2;
struct tySequence__uB9b75OUPRENsBAu4AnoePA;
struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content;
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
typedef NU8 tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g {
NI len; tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content* p;
};
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ {
tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q kind;
union{
NimStringV2 term;
NIM_CHAR ch;
NU8* charChoice;
tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA* nt;
NI index;
tySequence__5DSB9bTgCQCsIApS5TVlG8g sons;
};
};
struct TNimTypeV2 {
void* destructor;
NI size;
NI align;
NCSTRING name;
void* traceImpl;
void* disposeImpl;
void* typeInfoV1;
};
struct RootObj {
TNimTypeV2* m_type;
};
struct tySequence__uB9b75OUPRENsBAu4AnoePA {
NI len; tySequence__uB9b75OUPRENsBAu4AnoePA_Content* p;
};
struct Exception : public RootObj {
Exception* parent;
NCSTRING name;
NimStringV2 message;
tySequence__uB9b75OUPRENsBAu4AnoePA trace;
Exception* up;
};
#ifndef tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content_PP
#define tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content_PP
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content { NI cap; tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ data[SEQ_DECL_SIZE];};
#endif
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
#ifndef tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
#define tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content { NI cap; tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];};
#endif
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void, peg__43AZ7ZFAo8xUltgm3ekenw)(NimStringV2 pattern, tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ* Result);
static N_INLINE(TFrame*, getFrame)(void);
static N_INLINE(void, setFrame)(TFrame* s);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___uUSodrP7A4XpeMEslfRXgQ)(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ& dest);
static N_INLINE(void, initStackBottomWith)(void* locals);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_pegsDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[0+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
void* T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
}
static N_INLINE(TFrame*, getFrame)(void) {
TFrame* result;
result = (TFrame*)0;
result = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
return result;
}
static N_INLINE(void, setFrame)(TFrame* s) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_;
{ (*s).calldepth = ((NI16) 0);
} }
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
{ callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
} }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
systemInit000();
stdlib_pegsDatInit000();
(*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) {
{
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ colontmpD_;
TFrame* _nimCurFrame;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
std::exception_ptr T2_ = nullptr; _nimCurFrame = getFrame();
nimZeroMem((void*)(&colontmpD_), sizeof(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ));
try {
peg__43AZ7ZFAo8xUltgm3ekenw(TM__SRd76hP9cMfCzdUO857UhQQ_3, (&colontmpD_));
(void)(colontmpD_);
}
catch (Exception* T3_) {
setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
catch (...) { setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
{
eqdestroy___uUSodrP7A4XpeMEslfRXgQ(colontmpD_);
if (T2_) std::rethrow_exception(T2_);
}
popFrame();
}
} ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("pegs")
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("pegs"),
newIdentNode("peg")
),
newLit("")
)
)
) 1.2.0 :-1: FAILOutput
Stats
IR
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#include <exception>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# 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;
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ;
struct NimStrPayload;
struct NimStringV2;
struct tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA;
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g;
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content;
struct Exception;
struct RootObj;
struct TNimType;
struct tySequence__uB9b75OUPRENsBAu4AnoePA;
struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content;
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
typedef NU8 tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g {
NI len; tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content* p;
};
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ {
tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q kind;
union{
NimStringV2 term;
NIM_CHAR ch;
NU8* charChoice;
tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA* nt;
NI index;
tySequence__5DSB9bTgCQCsIApS5TVlG8g sons;
};
};
struct TNimType {
void* destructor;
NI size;
NCSTRING name;
void* traceImpl;
void* disposeImpl;
};
struct RootObj {
TNimType* m_type;
};
struct tySequence__uB9b75OUPRENsBAu4AnoePA {
NI len; tySequence__uB9b75OUPRENsBAu4AnoePA_Content* p;
};
struct Exception : public RootObj {
Exception* parent;
NCSTRING name;
NimStringV2 message;
tySequence__uB9b75OUPRENsBAu4AnoePA trace;
Exception* up;
};
#ifndef tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content_PP
#define tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content_PP
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content { NI cap; tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ data[SEQ_DECL_SIZE];};
#endif
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
#ifndef tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
#define tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content { NI cap; tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];};
#endif
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___mimbQZhtftl1WKcoel6Bww)(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ& dest, tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ src);
N_LIB_PRIVATE N_NIMCALL(void, peg__43AZ7ZFAo8xUltgm3ekenw)(NimStringV2 pattern, tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ* Result);
static N_INLINE(TFrame*, getFrame)(void);
static N_INLINE(void, setFrame)(TFrame* s);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___uUSodrP7A4XpeMEslfRXgQ)(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ& dest);
static N_INLINE(void, initStackBottomWith)(void* locals);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_pegsDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[0+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
void* T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
}
static N_INLINE(TFrame*, getFrame)(void) {
TFrame* result;
result = (TFrame*)0;
result = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
return result;
}
static N_INLINE(void, setFrame)(TFrame* s) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_;
{ (*s).calldepth = ((NI16) 0);
} }
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA8_;
{ callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
} }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
stdlib_pegsDatInit000();
(*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) {
{
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ colontmpD_;
TFrame* _nimCurFrame;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
_nimCurFrame = getFrame();
nimZeroMem((void*)(&colontmpD_), sizeof(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ));
std::exception_ptr T2_ = nullptr; try {
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ T4_;
nimZeroMem((void*)(&T4_), sizeof(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ));
peg__43AZ7ZFAo8xUltgm3ekenw(TM__SRd76hP9cMfCzdUO857UhQQ_3, (&T4_));
eqsink___mimbQZhtftl1WKcoel6Bww(colontmpD_, T4_);
(void)(colontmpD_);
}
catch (Exception* T3_) {
setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
catch (...) { setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
{
eqdestroy___uUSodrP7A4XpeMEslfRXgQ(colontmpD_);
if (T2_) std::rethrow_exception(T2_);
}
popFrame();
}
} ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("pegs")
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("pegs"),
newIdentNode("peg")
),
newLit("")
)
)
) 1.0.0 :-1: FAILOutput
Stats
IR
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#include <exception>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# 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;
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ;
struct NimStrPayload;
struct NimStringV2;
struct tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA;
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g;
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content;
struct Exception;
struct RootObj;
struct TNimType;
struct tySequence__uB9b75OUPRENsBAu4AnoePA;
struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content;
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
typedef NU8 tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g {
NI len; tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content* p;
};
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ {
tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q kind;
union{
NimStringV2 term;
NIM_CHAR ch;
NU8* charChoice;
tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA* nt;
NI index;
tySequence__5DSB9bTgCQCsIApS5TVlG8g sons;
};
};
struct TNimType {
void* destructor;
NI size;
NCSTRING name;
void* traceImpl;
void* disposeImpl;
};
struct RootObj {
TNimType* m_type;
};
struct tySequence__uB9b75OUPRENsBAu4AnoePA {
NI len; tySequence__uB9b75OUPRENsBAu4AnoePA_Content* p;
};
struct Exception : public RootObj {
Exception* parent;
NCSTRING name;
NimStringV2 message;
tySequence__uB9b75OUPRENsBAu4AnoePA trace;
Exception* up;
};
#ifndef tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content_PP
#define tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content_PP
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g_Content { NI cap; tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ data[SEQ_DECL_SIZE];};
#endif
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
#ifndef tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
#define tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content { NI cap; tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];};
#endif
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___mimbQZhtftl1WKcoel6Bww)(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ& dest, tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ src);
N_LIB_PRIVATE N_NIMCALL(void, peg__43AZ7ZFAo8xUltgm3ekenw)(NimStringV2 pattern, tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ* Result);
static N_INLINE(TFrame*, getFrame)(void);
static N_INLINE(void, setFrame)(TFrame* s);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___uUSodrP7A4XpeMEslfRXgQ)(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ& dest);
static N_INLINE(void, initStackBottomWith)(void* locals);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_pegsDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[0+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
void* T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
}
static N_INLINE(TFrame*, getFrame)(void) {
TFrame* result;
result = (TFrame*)0;
result = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
return result;
}
static N_INLINE(void, setFrame)(TFrame* s) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_;
{ (*s).calldepth = ((NI16) 0);
} }
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA8_;
{ callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
} }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
stdlib_pegsDatInit000();
(*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) {
{
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ colontmpD_;
TFrame* _nimCurFrame;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
_nimCurFrame = getFrame();
nimZeroMem((void*)(&colontmpD_), sizeof(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ));
std::exception_ptr T2_ = nullptr; try {
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ T4_;
nimZeroMem((void*)(&T4_), sizeof(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ));
peg__43AZ7ZFAo8xUltgm3ekenw(TM__SRd76hP9cMfCzdUO857UhQQ_3, (&T4_));
eqsink___mimbQZhtftl1WKcoel6Bww(colontmpD_, T4_);
(void)(colontmpD_);
}
catch (Exception* T3_) {
setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
catch (...) { setFrame(_nimCurFrame);
T2_ = std::current_exception();
}
{
eqdestroy___uUSodrP7A4XpeMEslfRXgQ(colontmpD_);
if (T2_) std::rethrow_exception(T2_);
}
popFrame();
}
} ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("pegs")
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("pegs"),
newIdentNode("peg")
),
newLit("")
)
)
) 44 minutes bisecting 6 commits at 0 commits per second.
|
!nim cpp --gc:refc --exceptions:goto import std/pegs
discard pegs.peg("") |
@juancarlospaco (contributor) devel :+1: OKOutput
Stats
stable :+1: OKOutput
Stats
1.6.0 :+1: OKOutput
Stats
1.4.0 :-1: FAILOutput
Stats
IR
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# 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;
struct NimStringDesc;
struct TGenericSeq;
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ;
struct tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA;
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc : public TGenericSeq {
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q;
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ {
tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q kind;
union{
NimStringDesc* term;
NIM_CHAR ch;
NU8* charChoice;
tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA* nt;
NI index;
tySequence__5DSB9bTgCQCsIApS5TVlG8g* sons;
};
};
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g : TGenericSeq {
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ data[SEQ_DECL_SIZE];
};
N_LIB_PRIVATE N_NIMCALL(void, peg__43AZ7ZFAo8xUltgm3ekenw)(NimStringDesc* pattern, tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ* Result);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_pegsDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
extern NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
void* T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_;
{ (*s).calldepth = ((NI16) 0);
} }
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
{ callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
} }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
stdlib_pegsDatInit000();
(*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) {
{
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ T1_;
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&T1_), sizeof(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ));
peg__43AZ7ZFAo8xUltgm3ekenw(((NimStringDesc*) NIM_NIL), (&T1_));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
(void)(T1_);
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
} ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("pegs")
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("pegs"),
newIdentNode("peg")
),
newLit("")
)
)
) 1.2.0 :-1: FAILOutput
Stats
IR
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# 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;
struct NimStringDesc;
struct TGenericSeq;
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ;
struct tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA;
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc : public TGenericSeq {
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q;
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ {
tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q kind;
union{
NimStringDesc* term;
NIM_CHAR ch;
NU8* charChoice;
tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA* nt;
NI index;
tySequence__5DSB9bTgCQCsIApS5TVlG8g* sons;
};
};
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g : TGenericSeq {
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ data[SEQ_DECL_SIZE];
};
N_LIB_PRIVATE N_NIMCALL(void, peg__43AZ7ZFAo8xUltgm3ekenw)(NimStringDesc* pattern, tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ* Result);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_pegsDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
extern NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
void* T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_;
{ (*s).calldepth = ((NI16) 0);
} }
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA8_;
{ callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
} }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
stdlib_pegsDatInit000();
(*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) {
{
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ T1_;
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&T1_), sizeof(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ));
peg__43AZ7ZFAo8xUltgm3ekenw(((NimStringDesc*) NIM_NIL), (&T1_));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
(void)(T1_);
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
} ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("pegs")
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("pegs"),
newIdentNode("peg")
),
newLit("")
)
)
) 1.0.0 :-1: FAILOutput
Stats
IR
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
# 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;
struct NimStringDesc;
struct TGenericSeq;
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ;
struct tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA;
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc : public TGenericSeq {
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q;
struct tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ {
tyEnum_PegKind__r9a6rAhGclsLWkBysfmtr6Q kind;
union{
NimStringDesc* term;
NIM_CHAR ch;
NU8* charChoice;
tyObject_NonTerminalObj__VMn2tGRm8B9a9cqMEec3KPEA* nt;
NI index;
tySequence__5DSB9bTgCQCsIApS5TVlG8g* sons;
};
};
struct tySequence__5DSB9bTgCQCsIApS5TVlG8g : TGenericSeq {
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ data[SEQ_DECL_SIZE];
};
N_LIB_PRIVATE N_NIMCALL(void, peg__43AZ7ZFAo8xUltgm3ekenw)(NimStringDesc* pattern, tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ* Result);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_pegsDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
extern NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
void* T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_;
{ (*s).calldepth = ((NI16) 0);
} }
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA8_;
{ callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
} }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
stdlib_pegsDatInit000();
(*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) {
{
tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ T1_;
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&T1_), sizeof(tyObject_Peg__4Bytir9b2lq5I84yi5O7ztQ));
peg__43AZ7ZFAo8xUltgm3ekenw(((NimStringDesc*) NIM_NIL), (&T1_));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
(void)(T1_);
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
} ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("pegs")
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("pegs"),
newIdentNode("peg")
),
newLit("")
)
)
) ??? ➡️ 🐛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). 11 minutes bisecting 9 commits at 1 commits per second.
|
@ringabout ARC bug, refc works, exception goto unrelated. |
Well, it's related. With goto exception, cpp backend crashs. |
I found another code that produce same error. teststdin.nim: import std/syncio
let l = stdin.readLine
echo l $ nim cpp --exceptions:goto teststdin.nim
CC: ../nim-2.1.1/lib/std/syncio.nim
/tmp/nimcache123/teststdin/debug/@m..@snim-2.1.1@slib@sstd@ssyncio.nim.cpp: In function 'void checkErr__stdZsyncio_u161(FILE*)'
:
/tmp/nimcache123/teststdin/debug/@m..@snim-2.1.1@slib@sstd@ssyncio.nim.cpp:291:25: error: jump to label 'LA6_'
291 | LA6_:;
| ^~~~
/tmp/nimcache123/teststdin/debug/@m..@snim-2.1.1@slib@sstd@ssyncio.nim.cpp:275:50: note: from here
275 | if (NIM_UNLIKELY(*nimErr_)) goto LA6_;
| ^~~~
/tmp/nimcache123/teststdin/debug/@m..@snim-2.1.1@slib@sstd@ssyncio.nim.cpp:276:26: note: crosses initialization of 'char* T8
'
276 | NCSTRING T8_ = strerror(errno);
| ^~~ gcc version 13.2.1 20230826 (Gentoo 13.2.1_p20230826 p7) $ nim -v
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2023-11-28
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: c31bbb07fb2d1ea8f69b47de50631442154bd3de
active boot switches: -d:release |
Description
Compiled with either:
nim cpp --mm:orc --exceptions:goto repro.nim
or
nim cpp --mm:arc --exceptions:goto repro.nim
creates C++ code which g++ 12.3 states is invalid.
Nim Version
Current
devel
:Debian's current 1.6:
Current Output
Expected Output
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: