Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Regression from 1.6 to 2.0 (not present in devel): Error: internal error: environment misses: m #23466

Closed
tersec opened this issue Mar 31, 2024 · 4 comments
Labels
Needs Backporting/Fixed in Devel The issues can be solved via backporting Status

Comments

@tersec
Copy link
Contributor

tersec commented Mar 31, 2024

Description

import std/tables

template k(m: untyped): untyped =
  var result: seq[typeof(m)]
  for x in m:
    result.add(x)
  result

iterator g(m: Table[int, int]): int =
  for h, e in m.keys.k:
    discard

  yield 0

proc y() =
  proc b() =
    for w in g(default(Table[int, int])):
      discard

  b()

y()

Nim Version

Nim Compiler Version 1.6.20 [Linux: amd64]
Compiled at 2024-03-31
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 8f9fde0615c686357774736c0bce6f3c2075a94d
active boot switches: -d:release
Nim Compiler Version 2.0.4 [Linux: amd64]
Compiled at 2024-03-31
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: b47747d31844c6bd9af4322efe55e24fefea544c
active boot switches: -d:release
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-03-31
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: cf00b2fd9e00909ac6368ece9515f0e020d7813d
active boot switches: -d:release

Current Output

In 1.6 and devel: compiles

In 2.0: r.nim(10, 15) Error: internal error: environment misses: m

ORC or refc doesn't affect results.

Expected Output

No internal error

Possible Solution

Backport fix from devel to version-2-0

Additional Information

No response

@ringabout ringabout added the Needs Backporting/Fixed in Devel The issues can be solved via backporting label Mar 31, 2024
@juancarlospaco
Copy link
Collaborator

!nim c

import std/tables

template k(m: untyped): untyped =
  var result: seq[typeof(m)]
  for x in m:
    result.add(x)
  result

iterator g(m: Table[int, int]): int =
  for h, e in m.keys.k:
    discard

  yield 0

proc y() =
  proc b() =
    for w in g(default(Table[int, int])):
      discard

  b()

y()

Copy link
Contributor

🐧 Linux bisect by @juancarlospaco (collaborator)
devel 👍 OK

Output


IR

Compiled filesize 99.02 Kb (101,392 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw tySequence__E8pi9b5QNahsURYzXMjh3qw;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content tySequence__E8pi9b5QNahsURYzXMjh3qw_Content;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct tyTuple__47w2DboNEPf69aPgubZdd7Q tyTuple__47w2DboNEPf69aPgubZdd7Q;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct tySequence__E8pi9b5QNahsURYzXMjh3qw {
NI len; tySequence__E8pi9b5QNahsURYzXMjh3qw_Content* p;
};
struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q {
 tySequence__E8pi9b5QNahsURYzXMjh3qw data;
 NI counter;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct tyTuple__47w2DboNEPf69aPgubZdd7Q {
NI Field0;
NI Field1;
NI Field2;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content { NI cap; tyTuple__47w2DboNEPf69aPgubZdd7Q data[SEQ_DECL_SIZE]; };
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void);
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NI, len__temp_u59)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q t_p0);
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4608)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(void, add__temp_u365)(tySequence__qwqHTkRvwhrRyENtudHQ7g* x_p0, NI y_p1);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u254)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, alignedDealloc)(void* p_p0, NI align_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u554)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q* dest_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[156+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 156 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/tables.nim(753, 13) `len(t) == L` the length of the table changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {156, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
static const struct {
NI cap; NIM_CHAR data[147+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_5 = { 147 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/system/iterators.nim(187, 11) `len(a) == L` the length of the seq changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_6 = {147, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_5};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4392;
extern NIM_THREADVAR TFrame* framePtr__system_u2688;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (&nimInErrorMode__system_u4392);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u2688 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u2688).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u2688;
 framePtr__system_u2688 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4608();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u2688 = (*framePtr__system_u2688).prev;
}
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0) {
 NIM_BOOL result;
 nimfr_("isFilled", "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/hashcommon.nim");
 result = !((hcode_p0 == ((NI)0)));
 popFrame();
 return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0) {
 if (dest_p0.p && !(dest_p0.p->cap & NIM_STRLIT_FLAG)) {
alignedDealloc(dest_p0.p, NIM_ALIGNOF(NI));
}
}
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1) {
 if ((*dest_p0).p != src_p1.p) {	eqdestroy___temp_u417((*dest_p0));
 }
(*dest_p0).len = src_p1.len; (*dest_p0).p = src_p1.p;
}
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void) {
NIM_BOOL* nimErr_;
 nimfr_("b", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 {
  tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q colontmp_;
  NI w;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  w = (NI)0;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  {
   tySequence__qwqHTkRvwhrRyENtudHQ7g colontmp__2;
   tySequence__qwqHTkRvwhrRyENtudHQ7g resultX60gensym2_;
   NI h;
   NI e;
   NI i;
   NI L_2;
   NI T18_;
   colontmp__2.len = 0; colontmp__2.p = NIM_NIL;
   resultX60gensym2_.len = 0; resultX60gensym2_.p = NIM_NIL;
   h = (NI)0;
   e = (NI)0;
   {
    NI* xX60gensym2_;
    NI L;
    xX60gensym2_ = (NI*)0;
    L = len__temp_u59(colontmp_);
    if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
    {
     NI h_2;
     NI colontmp__3;
     NI T5_;
     NI res;
     h_2 = (NI)0;
     colontmp__3 = (NI)0;
     T5_ = (colontmp_.data.len-1);
     colontmp__3 = T5_;
     res = ((NI)0);
     {
      while (1) {
       NI TM__SRd76hP9cMfCzdUO857UhQQ_4;
       if (!(res <= colontmp__3)) goto LA7;
       h_2 = ((NI) (res));
       {
        NIM_BOOL T10_;
        NI colontmpD_;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        T10_ = (NIM_BOOL)0;
        T10_ = isFilled__pureZcollectionsZtables_u31(colontmp_.data.p->data[h_2].Field0);
        if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        if (!T10_) goto LA11_;
        colontmpD_ = (NI)0;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        xX60gensym2_ = (&colontmp_.data.p->data[h_2].Field1);
        colontmpD_ = (*xX60gensym2_);
        add__temp_u365((&resultX60gensym2_), colontmpD_);
        {
         NI T15_;
         T15_ = (NI)0;
         T15_ = len__temp_u59(colontmp_);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
         if (!!((T15_ == L))) goto LA16_;
         failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_3);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        }
LA16_: ;
       }
LA11_: ;
       if (nimAddInt(res, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_4)) { raiseOverflow(); goto BeforeRet_;
       };
       res = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4);
      } LA7: ;
     }
    }
   }
   eqsink___temp_u426((&colontmp__2), resultX60gensym2_);
   i = ((NI)0);
   T18_ = colontmp__2.len;
   L_2 = T18_;
   {
    while (1) {
     if (!(i < L_2)) goto LA20;
     h = i;
     if (i < 0 || i >= colontmp__2.len){ raiseIndexError2(i,colontmp__2.len-1); goto BeforeRet_;
     }
     e = colontmp__2.p->data[i];
     i += ((NI)1);
     {
      NI T23_;
      T23_ = colontmp__2.len;
      if (!!((T23_ == L_2))) goto LA24_;
      failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_6);
      if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
     }
LA24_: ;
    } LA20: ;
   }
   eqdestroy___temp_u417(colontmp__2);
  }
  w = ((NI)0);
  eqdestroy___temp_u554((&colontmp_));
 }
 }BeforeRet_: ;
 popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void) {
NIM_BOOL* nimErr_;
 nimfr_("y", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 b__temp_u573();
 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();
 y__temp_u572();
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2024-03-31T14:03:43
  • Finished 2024-03-31T14:03:44
  • Duration
stable 👎 FAIL

Output

Error: Command failed: 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
/home/runner/work/Nim/Nim/temp.nim(8, 15) Error: internal error: environment misses: m
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(681, 5) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 99.02 Kb (101,392 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw tySequence__E8pi9b5QNahsURYzXMjh3qw;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content tySequence__E8pi9b5QNahsURYzXMjh3qw_Content;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct tyTuple__47w2DboNEPf69aPgubZdd7Q tyTuple__47w2DboNEPf69aPgubZdd7Q;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct tySequence__E8pi9b5QNahsURYzXMjh3qw {
NI len; tySequence__E8pi9b5QNahsURYzXMjh3qw_Content* p;
};
struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q {
 tySequence__E8pi9b5QNahsURYzXMjh3qw data;
 NI counter;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct tyTuple__47w2DboNEPf69aPgubZdd7Q {
NI Field0;
NI Field1;
NI Field2;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content { NI cap; tyTuple__47w2DboNEPf69aPgubZdd7Q data[SEQ_DECL_SIZE]; };
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void);
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NI, len__temp_u59)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q t_p0);
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4608)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(void, add__temp_u365)(tySequence__qwqHTkRvwhrRyENtudHQ7g* x_p0, NI y_p1);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u254)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, alignedDealloc)(void* p_p0, NI align_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u554)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q* dest_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[156+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 156 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/tables.nim(753, 13) `len(t) == L` the length of the table changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {156, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
static const struct {
NI cap; NIM_CHAR data[147+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_5 = { 147 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/system/iterators.nim(187, 11) `len(a) == L` the length of the seq changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_6 = {147, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_5};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4392;
extern NIM_THREADVAR TFrame* framePtr__system_u2688;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (&nimInErrorMode__system_u4392);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u2688 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u2688).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u2688;
 framePtr__system_u2688 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4608();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u2688 = (*framePtr__system_u2688).prev;
}
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0) {
 NIM_BOOL result;
 nimfr_("isFilled", "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/hashcommon.nim");
 result = !((hcode_p0 == ((NI)0)));
 popFrame();
 return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0) {
 if (dest_p0.p && !(dest_p0.p->cap & NIM_STRLIT_FLAG)) {
alignedDealloc(dest_p0.p, NIM_ALIGNOF(NI));
}
}
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1) {
 if ((*dest_p0).p != src_p1.p) {	eqdestroy___temp_u417((*dest_p0));
 }
(*dest_p0).len = src_p1.len; (*dest_p0).p = src_p1.p;
}
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void) {
NIM_BOOL* nimErr_;
 nimfr_("b", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 {
  tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q colontmp_;
  NI w;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  w = (NI)0;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  {
   tySequence__qwqHTkRvwhrRyENtudHQ7g colontmp__2;
   tySequence__qwqHTkRvwhrRyENtudHQ7g resultX60gensym2_;
   NI h;
   NI e;
   NI i;
   NI L_2;
   NI T18_;
   colontmp__2.len = 0; colontmp__2.p = NIM_NIL;
   resultX60gensym2_.len = 0; resultX60gensym2_.p = NIM_NIL;
   h = (NI)0;
   e = (NI)0;
   {
    NI* xX60gensym2_;
    NI L;
    xX60gensym2_ = (NI*)0;
    L = len__temp_u59(colontmp_);
    if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
    {
     NI h_2;
     NI colontmp__3;
     NI T5_;
     NI res;
     h_2 = (NI)0;
     colontmp__3 = (NI)0;
     T5_ = (colontmp_.data.len-1);
     colontmp__3 = T5_;
     res = ((NI)0);
     {
      while (1) {
       NI TM__SRd76hP9cMfCzdUO857UhQQ_4;
       if (!(res <= colontmp__3)) goto LA7;
       h_2 = ((NI) (res));
       {
        NIM_BOOL T10_;
        NI colontmpD_;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        T10_ = (NIM_BOOL)0;
        T10_ = isFilled__pureZcollectionsZtables_u31(colontmp_.data.p->data[h_2].Field0);
        if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        if (!T10_) goto LA11_;
        colontmpD_ = (NI)0;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        xX60gensym2_ = (&colontmp_.data.p->data[h_2].Field1);
        colontmpD_ = (*xX60gensym2_);
        add__temp_u365((&resultX60gensym2_), colontmpD_);
        {
         NI T15_;
         T15_ = (NI)0;
         T15_ = len__temp_u59(colontmp_);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
         if (!!((T15_ == L))) goto LA16_;
         failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_3);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        }
LA16_: ;
       }
LA11_: ;
       if (nimAddInt(res, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_4)) { raiseOverflow(); goto BeforeRet_;
       };
       res = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4);
      } LA7: ;
     }
    }
   }
   eqsink___temp_u426((&colontmp__2), resultX60gensym2_);
   i = ((NI)0);
   T18_ = colontmp__2.len;
   L_2 = T18_;
   {
    while (1) {
     if (!(i < L_2)) goto LA20;
     h = i;
     if (i < 0 || i >= colontmp__2.len){ raiseIndexError2(i,colontmp__2.len-1); goto BeforeRet_;
     }
     e = colontmp__2.p->data[i];
     i += ((NI)1);
     {
      NI T23_;
      T23_ = colontmp__2.len;
      if (!!((T23_ == L_2))) goto LA24_;
      failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_6);
      if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
     }
LA24_: ;
    } LA20: ;
   }
   eqdestroy___temp_u417(colontmp__2);
  }
  w = ((NI)0);
  eqdestroy___temp_u554((&colontmp_));
 }
 }BeforeRet_: ;
 popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void) {
NIM_BOOL* nimErr_;
 nimfr_("y", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 b__temp_u573();
 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();
 y__temp_u572();
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2024-03-31T14:03:44
  • Finished 2024-03-31T14:03:44
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkTemplateDef.newTree(
    newIdentNode("k"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("untyped"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        newIdentNode("untyped"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("result"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            nnkCall.newTree(
              newIdentNode("typeof"),
              newIdentNode("m")
            )
          ),
          newEmptyNode()
        )
      ),
      nnkForStmt.newTree(
        newIdentNode("x"),
        newIdentNode("m"),
        nnkStmtList.newTree(
          nnkCall.newTree(
            nnkDotExpr.newTree(
              newIdentNode("result"),
              newIdentNode("add")
            ),
            newIdentNode("x")
          )
        )
      ),
      newIdentNode("result")
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("g"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("int"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        nnkBracketExpr.newTree(
          newIdentNode("Table"),
          newIdentNode("int"),
          newIdentNode("int")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkForStmt.newTree(
        newIdentNode("h"),
        newIdentNode("e"),
        nnkDotExpr.newTree(
          nnkDotExpr.newTree(
            newIdentNode("m"),
            newIdentNode("keys")
          ),
          newIdentNode("k")
        ),
        nnkStmtList.newTree(
          nnkDiscardStmt.newTree(
            newEmptyNode()
          )
        )
      ),
      nnkYieldStmt.newTree(
        newLit(0)
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("y"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode()
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("b"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("w"),
            nnkCall.newTree(
              newIdentNode("g"),
              nnkCall.newTree(
                newIdentNode("default"),
                nnkBracketExpr.newTree(
                  newIdentNode("Table"),
                  newIdentNode("int"),
                  newIdentNode("int")
                )
              )
            ),
            nnkStmtList.newTree(
              nnkDiscardStmt.newTree(
                newEmptyNode()
              )
            )
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("b")
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("y")
  )
)
2.0.2 👎 FAIL

Output

Error: Command failed: 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
/home/runner/work/Nim/Nim/temp.nim(8, 15) Error: internal error: environment misses: m
assertions.nim(34)       raiseAssert
Error: unhandled exception: options.nim(681, 5) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 99.02 Kb (101,392 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw tySequence__E8pi9b5QNahsURYzXMjh3qw;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content tySequence__E8pi9b5QNahsURYzXMjh3qw_Content;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct tyTuple__47w2DboNEPf69aPgubZdd7Q tyTuple__47w2DboNEPf69aPgubZdd7Q;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct tySequence__E8pi9b5QNahsURYzXMjh3qw {
NI len; tySequence__E8pi9b5QNahsURYzXMjh3qw_Content* p;
};
struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q {
 tySequence__E8pi9b5QNahsURYzXMjh3qw data;
 NI counter;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct tyTuple__47w2DboNEPf69aPgubZdd7Q {
NI Field0;
NI Field1;
NI Field2;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content { NI cap; tyTuple__47w2DboNEPf69aPgubZdd7Q data[SEQ_DECL_SIZE]; };
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void);
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NI, len__temp_u59)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q t_p0);
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4608)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(void, add__temp_u365)(tySequence__qwqHTkRvwhrRyENtudHQ7g* x_p0, NI y_p1);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u254)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, alignedDealloc)(void* p_p0, NI align_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u554)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q* dest_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[156+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 156 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/tables.nim(753, 13) `len(t) == L` the length of the table changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {156, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
static const struct {
NI cap; NIM_CHAR data[147+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_5 = { 147 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/system/iterators.nim(187, 11) `len(a) == L` the length of the seq changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_6 = {147, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_5};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4392;
extern NIM_THREADVAR TFrame* framePtr__system_u2688;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (&nimInErrorMode__system_u4392);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u2688 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u2688).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u2688;
 framePtr__system_u2688 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4608();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u2688 = (*framePtr__system_u2688).prev;
}
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0) {
 NIM_BOOL result;
 nimfr_("isFilled", "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/hashcommon.nim");
 result = !((hcode_p0 == ((NI)0)));
 popFrame();
 return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0) {
 if (dest_p0.p && !(dest_p0.p->cap & NIM_STRLIT_FLAG)) {
alignedDealloc(dest_p0.p, NIM_ALIGNOF(NI));
}
}
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1) {
 if ((*dest_p0).p != src_p1.p) {	eqdestroy___temp_u417((*dest_p0));
 }
(*dest_p0).len = src_p1.len; (*dest_p0).p = src_p1.p;
}
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void) {
NIM_BOOL* nimErr_;
 nimfr_("b", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 {
  tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q colontmp_;
  NI w;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  w = (NI)0;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  {
   tySequence__qwqHTkRvwhrRyENtudHQ7g colontmp__2;
   tySequence__qwqHTkRvwhrRyENtudHQ7g resultX60gensym2_;
   NI h;
   NI e;
   NI i;
   NI L_2;
   NI T18_;
   colontmp__2.len = 0; colontmp__2.p = NIM_NIL;
   resultX60gensym2_.len = 0; resultX60gensym2_.p = NIM_NIL;
   h = (NI)0;
   e = (NI)0;
   {
    NI* xX60gensym2_;
    NI L;
    xX60gensym2_ = (NI*)0;
    L = len__temp_u59(colontmp_);
    if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
    {
     NI h_2;
     NI colontmp__3;
     NI T5_;
     NI res;
     h_2 = (NI)0;
     colontmp__3 = (NI)0;
     T5_ = (colontmp_.data.len-1);
     colontmp__3 = T5_;
     res = ((NI)0);
     {
      while (1) {
       NI TM__SRd76hP9cMfCzdUO857UhQQ_4;
       if (!(res <= colontmp__3)) goto LA7;
       h_2 = ((NI) (res));
       {
        NIM_BOOL T10_;
        NI colontmpD_;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        T10_ = (NIM_BOOL)0;
        T10_ = isFilled__pureZcollectionsZtables_u31(colontmp_.data.p->data[h_2].Field0);
        if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        if (!T10_) goto LA11_;
        colontmpD_ = (NI)0;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        xX60gensym2_ = (&colontmp_.data.p->data[h_2].Field1);
        colontmpD_ = (*xX60gensym2_);
        add__temp_u365((&resultX60gensym2_), colontmpD_);
        {
         NI T15_;
         T15_ = (NI)0;
         T15_ = len__temp_u59(colontmp_);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
         if (!!((T15_ == L))) goto LA16_;
         failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_3);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        }
LA16_: ;
       }
LA11_: ;
       if (nimAddInt(res, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_4)) { raiseOverflow(); goto BeforeRet_;
       };
       res = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4);
      } LA7: ;
     }
    }
   }
   eqsink___temp_u426((&colontmp__2), resultX60gensym2_);
   i = ((NI)0);
   T18_ = colontmp__2.len;
   L_2 = T18_;
   {
    while (1) {
     if (!(i < L_2)) goto LA20;
     h = i;
     if (i < 0 || i >= colontmp__2.len){ raiseIndexError2(i,colontmp__2.len-1); goto BeforeRet_;
     }
     e = colontmp__2.p->data[i];
     i += ((NI)1);
     {
      NI T23_;
      T23_ = colontmp__2.len;
      if (!!((T23_ == L_2))) goto LA24_;
      failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_6);
      if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
     }
LA24_: ;
    } LA20: ;
   }
   eqdestroy___temp_u417(colontmp__2);
  }
  w = ((NI)0);
  eqdestroy___temp_u554((&colontmp_));
 }
 }BeforeRet_: ;
 popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void) {
NIM_BOOL* nimErr_;
 nimfr_("y", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 b__temp_u573();
 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();
 y__temp_u572();
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2024-03-31T14:03:45
  • Finished 2024-03-31T14:03:45
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkTemplateDef.newTree(
    newIdentNode("k"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("untyped"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        newIdentNode("untyped"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("result"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            nnkCall.newTree(
              newIdentNode("typeof"),
              newIdentNode("m")
            )
          ),
          newEmptyNode()
        )
      ),
      nnkForStmt.newTree(
        newIdentNode("x"),
        newIdentNode("m"),
        nnkStmtList.newTree(
          nnkCall.newTree(
            nnkDotExpr.newTree(
              newIdentNode("result"),
              newIdentNode("add")
            ),
            newIdentNode("x")
          )
        )
      ),
      newIdentNode("result")
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("g"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("int"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        nnkBracketExpr.newTree(
          newIdentNode("Table"),
          newIdentNode("int"),
          newIdentNode("int")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkForStmt.newTree(
        newIdentNode("h"),
        newIdentNode("e"),
        nnkDotExpr.newTree(
          nnkDotExpr.newTree(
            newIdentNode("m"),
            newIdentNode("keys")
          ),
          newIdentNode("k")
        ),
        nnkStmtList.newTree(
          nnkDiscardStmt.newTree(
            newEmptyNode()
          )
        )
      ),
      nnkYieldStmt.newTree(
        newLit(0)
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("y"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode()
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("b"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("w"),
            nnkCall.newTree(
              newIdentNode("g"),
              nnkCall.newTree(
                newIdentNode("default"),
                nnkBracketExpr.newTree(
                  newIdentNode("Table"),
                  newIdentNode("int"),
                  newIdentNode("int")
                )
              )
            ),
            nnkStmtList.newTree(
              nnkDiscardStmt.newTree(
                newEmptyNode()
              )
            )
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("b")
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("y")
  )
)
1.6.14 👎 FAIL

Output

Error: Command failed: 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
/home/runner/work/Nim/Nim/temp.nim(8, 15) Error: internal error: environment misses: m
fatal.nim(54)            sysFatal
Error: unhandled exception: options.nim(645, 14) `false` errGenerated [AssertionDefect]

IR

Compiled filesize 99.02 Kb (101,392 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw tySequence__E8pi9b5QNahsURYzXMjh3qw;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content tySequence__E8pi9b5QNahsURYzXMjh3qw_Content;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct tyTuple__47w2DboNEPf69aPgubZdd7Q tyTuple__47w2DboNEPf69aPgubZdd7Q;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct tySequence__E8pi9b5QNahsURYzXMjh3qw {
NI len; tySequence__E8pi9b5QNahsURYzXMjh3qw_Content* p;
};
struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q {
 tySequence__E8pi9b5QNahsURYzXMjh3qw data;
 NI counter;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct tyTuple__47w2DboNEPf69aPgubZdd7Q {
NI Field0;
NI Field1;
NI Field2;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content { NI cap; tyTuple__47w2DboNEPf69aPgubZdd7Q data[SEQ_DECL_SIZE]; };
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void);
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NI, len__temp_u59)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q t_p0);
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4608)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(void, add__temp_u365)(tySequence__qwqHTkRvwhrRyENtudHQ7g* x_p0, NI y_p1);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u254)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, alignedDealloc)(void* p_p0, NI align_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u554)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q* dest_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[156+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 156 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/tables.nim(753, 13) `len(t) == L` the length of the table changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {156, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
static const struct {
NI cap; NIM_CHAR data[147+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_5 = { 147 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/system/iterators.nim(187, 11) `len(a) == L` the length of the seq changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_6 = {147, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_5};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4392;
extern NIM_THREADVAR TFrame* framePtr__system_u2688;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (&nimInErrorMode__system_u4392);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u2688 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u2688).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u2688;
 framePtr__system_u2688 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4608();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u2688 = (*framePtr__system_u2688).prev;
}
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0) {
 NIM_BOOL result;
 nimfr_("isFilled", "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/hashcommon.nim");
 result = !((hcode_p0 == ((NI)0)));
 popFrame();
 return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0) {
 if (dest_p0.p && !(dest_p0.p->cap & NIM_STRLIT_FLAG)) {
alignedDealloc(dest_p0.p, NIM_ALIGNOF(NI));
}
}
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1) {
 if ((*dest_p0).p != src_p1.p) {	eqdestroy___temp_u417((*dest_p0));
 }
(*dest_p0).len = src_p1.len; (*dest_p0).p = src_p1.p;
}
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void) {
NIM_BOOL* nimErr_;
 nimfr_("b", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 {
  tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q colontmp_;
  NI w;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  w = (NI)0;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  {
   tySequence__qwqHTkRvwhrRyENtudHQ7g colontmp__2;
   tySequence__qwqHTkRvwhrRyENtudHQ7g resultX60gensym2_;
   NI h;
   NI e;
   NI i;
   NI L_2;
   NI T18_;
   colontmp__2.len = 0; colontmp__2.p = NIM_NIL;
   resultX60gensym2_.len = 0; resultX60gensym2_.p = NIM_NIL;
   h = (NI)0;
   e = (NI)0;
   {
    NI* xX60gensym2_;
    NI L;
    xX60gensym2_ = (NI*)0;
    L = len__temp_u59(colontmp_);
    if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
    {
     NI h_2;
     NI colontmp__3;
     NI T5_;
     NI res;
     h_2 = (NI)0;
     colontmp__3 = (NI)0;
     T5_ = (colontmp_.data.len-1);
     colontmp__3 = T5_;
     res = ((NI)0);
     {
      while (1) {
       NI TM__SRd76hP9cMfCzdUO857UhQQ_4;
       if (!(res <= colontmp__3)) goto LA7;
       h_2 = ((NI) (res));
       {
        NIM_BOOL T10_;
        NI colontmpD_;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        T10_ = (NIM_BOOL)0;
        T10_ = isFilled__pureZcollectionsZtables_u31(colontmp_.data.p->data[h_2].Field0);
        if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        if (!T10_) goto LA11_;
        colontmpD_ = (NI)0;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        xX60gensym2_ = (&colontmp_.data.p->data[h_2].Field1);
        colontmpD_ = (*xX60gensym2_);
        add__temp_u365((&resultX60gensym2_), colontmpD_);
        {
         NI T15_;
         T15_ = (NI)0;
         T15_ = len__temp_u59(colontmp_);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
         if (!!((T15_ == L))) goto LA16_;
         failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_3);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        }
LA16_: ;
       }
LA11_: ;
       if (nimAddInt(res, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_4)) { raiseOverflow(); goto BeforeRet_;
       };
       res = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4);
      } LA7: ;
     }
    }
   }
   eqsink___temp_u426((&colontmp__2), resultX60gensym2_);
   i = ((NI)0);
   T18_ = colontmp__2.len;
   L_2 = T18_;
   {
    while (1) {
     if (!(i < L_2)) goto LA20;
     h = i;
     if (i < 0 || i >= colontmp__2.len){ raiseIndexError2(i,colontmp__2.len-1); goto BeforeRet_;
     }
     e = colontmp__2.p->data[i];
     i += ((NI)1);
     {
      NI T23_;
      T23_ = colontmp__2.len;
      if (!!((T23_ == L_2))) goto LA24_;
      failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_6);
      if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
     }
LA24_: ;
    } LA20: ;
   }
   eqdestroy___temp_u417(colontmp__2);
  }
  w = ((NI)0);
  eqdestroy___temp_u554((&colontmp_));
 }
 }BeforeRet_: ;
 popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void) {
NIM_BOOL* nimErr_;
 nimfr_("y", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 b__temp_u573();
 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();
 y__temp_u572();
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2024-03-31T14:03:48
  • Finished 2024-03-31T14:03:48
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkTemplateDef.newTree(
    newIdentNode("k"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("untyped"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        newIdentNode("untyped"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("result"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            nnkCall.newTree(
              newIdentNode("typeof"),
              newIdentNode("m")
            )
          ),
          newEmptyNode()
        )
      ),
      nnkForStmt.newTree(
        newIdentNode("x"),
        newIdentNode("m"),
        nnkStmtList.newTree(
          nnkCall.newTree(
            nnkDotExpr.newTree(
              newIdentNode("result"),
              newIdentNode("add")
            ),
            newIdentNode("x")
          )
        )
      ),
      newIdentNode("result")
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("g"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("int"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        nnkBracketExpr.newTree(
          newIdentNode("Table"),
          newIdentNode("int"),
          newIdentNode("int")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkForStmt.newTree(
        newIdentNode("h"),
        newIdentNode("e"),
        nnkDotExpr.newTree(
          nnkDotExpr.newTree(
            newIdentNode("m"),
            newIdentNode("keys")
          ),
          newIdentNode("k")
        ),
        nnkStmtList.newTree(
          nnkDiscardStmt.newTree(
            newEmptyNode()
          )
        )
      ),
      nnkYieldStmt.newTree(
        newLit(0)
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("y"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode()
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("b"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("w"),
            nnkCall.newTree(
              newIdentNode("g"),
              nnkCall.newTree(
                newIdentNode("default"),
                nnkBracketExpr.newTree(
                  newIdentNode("Table"),
                  newIdentNode("int"),
                  newIdentNode("int")
                )
              )
            ),
            nnkStmtList.newTree(
              nnkDiscardStmt.newTree(
                newEmptyNode()
              )
            )
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("b")
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("y")
  )
)
1.4.8 👎 FAIL

Output

Error: Command failed: 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
/home/runner/work/Nim/Nim/temp.nim(8, 15) Error: internal error: environment misses: m

IR

Compiled filesize 99.02 Kb (101,392 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw tySequence__E8pi9b5QNahsURYzXMjh3qw;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content tySequence__E8pi9b5QNahsURYzXMjh3qw_Content;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct tyTuple__47w2DboNEPf69aPgubZdd7Q tyTuple__47w2DboNEPf69aPgubZdd7Q;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct tySequence__E8pi9b5QNahsURYzXMjh3qw {
NI len; tySequence__E8pi9b5QNahsURYzXMjh3qw_Content* p;
};
struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q {
 tySequence__E8pi9b5QNahsURYzXMjh3qw data;
 NI counter;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct tyTuple__47w2DboNEPf69aPgubZdd7Q {
NI Field0;
NI Field1;
NI Field2;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content { NI cap; tyTuple__47w2DboNEPf69aPgubZdd7Q data[SEQ_DECL_SIZE]; };
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void);
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NI, len__temp_u59)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q t_p0);
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4608)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(void, add__temp_u365)(tySequence__qwqHTkRvwhrRyENtudHQ7g* x_p0, NI y_p1);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u254)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, alignedDealloc)(void* p_p0, NI align_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u554)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q* dest_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[156+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 156 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/tables.nim(753, 13) `len(t) == L` the length of the table changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {156, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
static const struct {
NI cap; NIM_CHAR data[147+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_5 = { 147 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/system/iterators.nim(187, 11) `len(a) == L` the length of the seq changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_6 = {147, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_5};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4392;
extern NIM_THREADVAR TFrame* framePtr__system_u2688;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (&nimInErrorMode__system_u4392);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u2688 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u2688).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u2688;
 framePtr__system_u2688 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4608();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u2688 = (*framePtr__system_u2688).prev;
}
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0) {
 NIM_BOOL result;
 nimfr_("isFilled", "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/hashcommon.nim");
 result = !((hcode_p0 == ((NI)0)));
 popFrame();
 return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0) {
 if (dest_p0.p && !(dest_p0.p->cap & NIM_STRLIT_FLAG)) {
alignedDealloc(dest_p0.p, NIM_ALIGNOF(NI));
}
}
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1) {
 if ((*dest_p0).p != src_p1.p) {	eqdestroy___temp_u417((*dest_p0));
 }
(*dest_p0).len = src_p1.len; (*dest_p0).p = src_p1.p;
}
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void) {
NIM_BOOL* nimErr_;
 nimfr_("b", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 {
  tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q colontmp_;
  NI w;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  w = (NI)0;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  {
   tySequence__qwqHTkRvwhrRyENtudHQ7g colontmp__2;
   tySequence__qwqHTkRvwhrRyENtudHQ7g resultX60gensym2_;
   NI h;
   NI e;
   NI i;
   NI L_2;
   NI T18_;
   colontmp__2.len = 0; colontmp__2.p = NIM_NIL;
   resultX60gensym2_.len = 0; resultX60gensym2_.p = NIM_NIL;
   h = (NI)0;
   e = (NI)0;
   {
    NI* xX60gensym2_;
    NI L;
    xX60gensym2_ = (NI*)0;
    L = len__temp_u59(colontmp_);
    if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
    {
     NI h_2;
     NI colontmp__3;
     NI T5_;
     NI res;
     h_2 = (NI)0;
     colontmp__3 = (NI)0;
     T5_ = (colontmp_.data.len-1);
     colontmp__3 = T5_;
     res = ((NI)0);
     {
      while (1) {
       NI TM__SRd76hP9cMfCzdUO857UhQQ_4;
       if (!(res <= colontmp__3)) goto LA7;
       h_2 = ((NI) (res));
       {
        NIM_BOOL T10_;
        NI colontmpD_;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        T10_ = (NIM_BOOL)0;
        T10_ = isFilled__pureZcollectionsZtables_u31(colontmp_.data.p->data[h_2].Field0);
        if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        if (!T10_) goto LA11_;
        colontmpD_ = (NI)0;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        xX60gensym2_ = (&colontmp_.data.p->data[h_2].Field1);
        colontmpD_ = (*xX60gensym2_);
        add__temp_u365((&resultX60gensym2_), colontmpD_);
        {
         NI T15_;
         T15_ = (NI)0;
         T15_ = len__temp_u59(colontmp_);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
         if (!!((T15_ == L))) goto LA16_;
         failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_3);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        }
LA16_: ;
       }
LA11_: ;
       if (nimAddInt(res, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_4)) { raiseOverflow(); goto BeforeRet_;
       };
       res = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4);
      } LA7: ;
     }
    }
   }
   eqsink___temp_u426((&colontmp__2), resultX60gensym2_);
   i = ((NI)0);
   T18_ = colontmp__2.len;
   L_2 = T18_;
   {
    while (1) {
     if (!(i < L_2)) goto LA20;
     h = i;
     if (i < 0 || i >= colontmp__2.len){ raiseIndexError2(i,colontmp__2.len-1); goto BeforeRet_;
     }
     e = colontmp__2.p->data[i];
     i += ((NI)1);
     {
      NI T23_;
      T23_ = colontmp__2.len;
      if (!!((T23_ == L_2))) goto LA24_;
      failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_6);
      if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
     }
LA24_: ;
    } LA20: ;
   }
   eqdestroy___temp_u417(colontmp__2);
  }
  w = ((NI)0);
  eqdestroy___temp_u554((&colontmp_));
 }
 }BeforeRet_: ;
 popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void) {
NIM_BOOL* nimErr_;
 nimfr_("y", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 b__temp_u573();
 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();
 y__temp_u572();
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2024-03-31T14:03:50
  • Finished 2024-03-31T14:03:51
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkTemplateDef.newTree(
    newIdentNode("k"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("untyped"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        newIdentNode("untyped"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("result"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            nnkCall.newTree(
              newIdentNode("typeof"),
              newIdentNode("m")
            )
          ),
          newEmptyNode()
        )
      ),
      nnkForStmt.newTree(
        newIdentNode("x"),
        newIdentNode("m"),
        nnkStmtList.newTree(
          nnkCall.newTree(
            nnkDotExpr.newTree(
              newIdentNode("result"),
              newIdentNode("add")
            ),
            newIdentNode("x")
          )
        )
      ),
      newIdentNode("result")
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("g"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("int"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        nnkBracketExpr.newTree(
          newIdentNode("Table"),
          newIdentNode("int"),
          newIdentNode("int")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkForStmt.newTree(
        newIdentNode("h"),
        newIdentNode("e"),
        nnkDotExpr.newTree(
          nnkDotExpr.newTree(
            newIdentNode("m"),
            newIdentNode("keys")
          ),
          newIdentNode("k")
        ),
        nnkStmtList.newTree(
          nnkDiscardStmt.newTree(
            newEmptyNode()
          )
        )
      ),
      nnkYieldStmt.newTree(
        newLit(0)
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("y"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode()
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("b"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("w"),
            nnkCall.newTree(
              newIdentNode("g"),
              nnkCall.newTree(
                newIdentNode("default"),
                nnkBracketExpr.newTree(
                  newIdentNode("Table"),
                  newIdentNode("int"),
                  newIdentNode("int")
                )
              )
            ),
            nnkStmtList.newTree(
              nnkDiscardStmt.newTree(
                newEmptyNode()
              )
            )
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("b")
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("y")
  )
)
1.2.18 👎 FAIL

Output

Error: Command failed: 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
/home/runner/work/Nim/Nim/temp.nim(8, 15) Error: internal error: environment misses: m

IR

Compiled filesize 99.02 Kb (101,392 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw tySequence__E8pi9b5QNahsURYzXMjh3qw;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content tySequence__E8pi9b5QNahsURYzXMjh3qw_Content;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct tyTuple__47w2DboNEPf69aPgubZdd7Q tyTuple__47w2DboNEPf69aPgubZdd7Q;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct tySequence__E8pi9b5QNahsURYzXMjh3qw {
NI len; tySequence__E8pi9b5QNahsURYzXMjh3qw_Content* p;
};
struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q {
 tySequence__E8pi9b5QNahsURYzXMjh3qw data;
 NI counter;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct tyTuple__47w2DboNEPf69aPgubZdd7Q {
NI Field0;
NI Field1;
NI Field2;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content { NI cap; tyTuple__47w2DboNEPf69aPgubZdd7Q data[SEQ_DECL_SIZE]; };
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void);
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NI, len__temp_u59)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q t_p0);
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4608)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(void, add__temp_u365)(tySequence__qwqHTkRvwhrRyENtudHQ7g* x_p0, NI y_p1);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u254)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, alignedDealloc)(void* p_p0, NI align_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u554)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q* dest_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[156+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 156 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/tables.nim(753, 13) `len(t) == L` the length of the table changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {156, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
static const struct {
NI cap; NIM_CHAR data[147+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_5 = { 147 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/system/iterators.nim(187, 11) `len(a) == L` the length of the seq changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_6 = {147, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_5};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4392;
extern NIM_THREADVAR TFrame* framePtr__system_u2688;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (&nimInErrorMode__system_u4392);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u2688 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u2688).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u2688;
 framePtr__system_u2688 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4608();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u2688 = (*framePtr__system_u2688).prev;
}
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0) {
 NIM_BOOL result;
 nimfr_("isFilled", "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/hashcommon.nim");
 result = !((hcode_p0 == ((NI)0)));
 popFrame();
 return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0) {
 if (dest_p0.p && !(dest_p0.p->cap & NIM_STRLIT_FLAG)) {
alignedDealloc(dest_p0.p, NIM_ALIGNOF(NI));
}
}
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1) {
 if ((*dest_p0).p != src_p1.p) {	eqdestroy___temp_u417((*dest_p0));
 }
(*dest_p0).len = src_p1.len; (*dest_p0).p = src_p1.p;
}
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void) {
NIM_BOOL* nimErr_;
 nimfr_("b", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 {
  tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q colontmp_;
  NI w;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  w = (NI)0;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  {
   tySequence__qwqHTkRvwhrRyENtudHQ7g colontmp__2;
   tySequence__qwqHTkRvwhrRyENtudHQ7g resultX60gensym2_;
   NI h;
   NI e;
   NI i;
   NI L_2;
   NI T18_;
   colontmp__2.len = 0; colontmp__2.p = NIM_NIL;
   resultX60gensym2_.len = 0; resultX60gensym2_.p = NIM_NIL;
   h = (NI)0;
   e = (NI)0;
   {
    NI* xX60gensym2_;
    NI L;
    xX60gensym2_ = (NI*)0;
    L = len__temp_u59(colontmp_);
    if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
    {
     NI h_2;
     NI colontmp__3;
     NI T5_;
     NI res;
     h_2 = (NI)0;
     colontmp__3 = (NI)0;
     T5_ = (colontmp_.data.len-1);
     colontmp__3 = T5_;
     res = ((NI)0);
     {
      while (1) {
       NI TM__SRd76hP9cMfCzdUO857UhQQ_4;
       if (!(res <= colontmp__3)) goto LA7;
       h_2 = ((NI) (res));
       {
        NIM_BOOL T10_;
        NI colontmpD_;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        T10_ = (NIM_BOOL)0;
        T10_ = isFilled__pureZcollectionsZtables_u31(colontmp_.data.p->data[h_2].Field0);
        if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        if (!T10_) goto LA11_;
        colontmpD_ = (NI)0;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        xX60gensym2_ = (&colontmp_.data.p->data[h_2].Field1);
        colontmpD_ = (*xX60gensym2_);
        add__temp_u365((&resultX60gensym2_), colontmpD_);
        {
         NI T15_;
         T15_ = (NI)0;
         T15_ = len__temp_u59(colontmp_);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
         if (!!((T15_ == L))) goto LA16_;
         failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_3);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        }
LA16_: ;
       }
LA11_: ;
       if (nimAddInt(res, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_4)) { raiseOverflow(); goto BeforeRet_;
       };
       res = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4);
      } LA7: ;
     }
    }
   }
   eqsink___temp_u426((&colontmp__2), resultX60gensym2_);
   i = ((NI)0);
   T18_ = colontmp__2.len;
   L_2 = T18_;
   {
    while (1) {
     if (!(i < L_2)) goto LA20;
     h = i;
     if (i < 0 || i >= colontmp__2.len){ raiseIndexError2(i,colontmp__2.len-1); goto BeforeRet_;
     }
     e = colontmp__2.p->data[i];
     i += ((NI)1);
     {
      NI T23_;
      T23_ = colontmp__2.len;
      if (!!((T23_ == L_2))) goto LA24_;
      failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_6);
      if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
     }
LA24_: ;
    } LA20: ;
   }
   eqdestroy___temp_u417(colontmp__2);
  }
  w = ((NI)0);
  eqdestroy___temp_u554((&colontmp_));
 }
 }BeforeRet_: ;
 popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void) {
NIM_BOOL* nimErr_;
 nimfr_("y", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 b__temp_u573();
 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();
 y__temp_u572();
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2024-03-31T14:03:53
  • Finished 2024-03-31T14:03:53
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkTemplateDef.newTree(
    newIdentNode("k"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("untyped"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        newIdentNode("untyped"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("result"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            nnkCall.newTree(
              newIdentNode("typeof"),
              newIdentNode("m")
            )
          ),
          newEmptyNode()
        )
      ),
      nnkForStmt.newTree(
        newIdentNode("x"),
        newIdentNode("m"),
        nnkStmtList.newTree(
          nnkCall.newTree(
            nnkDotExpr.newTree(
              newIdentNode("result"),
              newIdentNode("add")
            ),
            newIdentNode("x")
          )
        )
      ),
      newIdentNode("result")
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("g"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("int"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        nnkBracketExpr.newTree(
          newIdentNode("Table"),
          newIdentNode("int"),
          newIdentNode("int")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkForStmt.newTree(
        newIdentNode("h"),
        newIdentNode("e"),
        nnkDotExpr.newTree(
          nnkDotExpr.newTree(
            newIdentNode("m"),
            newIdentNode("keys")
          ),
          newIdentNode("k")
        ),
        nnkStmtList.newTree(
          nnkDiscardStmt.newTree(
            newEmptyNode()
          )
        )
      ),
      nnkYieldStmt.newTree(
        newLit(0)
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("y"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode()
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("b"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("w"),
            nnkCall.newTree(
              newIdentNode("g"),
              nnkCall.newTree(
                newIdentNode("default"),
                nnkBracketExpr.newTree(
                  newIdentNode("Table"),
                  newIdentNode("int"),
                  newIdentNode("int")
                )
              )
            ),
            nnkStmtList.newTree(
              nnkDiscardStmt.newTree(
                newEmptyNode()
              )
            )
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("b")
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("y")
  )
)
1.0.10 👎 FAIL

Output

Error: Command failed: 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
/home/runner/work/Nim/Nim/temp.nim(8, 15) Error: internal error: environment misses: m

IR

Compiled filesize 99.02 Kb (101,392 bytes)
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
 struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
 FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
 FR_.line = n;
#define nimlf_(n, file) \
 FR_.line = n; FR_.filename = file;
typedef struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw tySequence__E8pi9b5QNahsURYzXMjh3qw;
typedef struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content tySequence__E8pi9b5QNahsURYzXMjh3qw_Content;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g tySequence__qwqHTkRvwhrRyENtudHQ7g;
typedef struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content tySequence__qwqHTkRvwhrRyENtudHQ7g_Content;
typedef struct tyTuple__47w2DboNEPf69aPgubZdd7Q tyTuple__47w2DboNEPf69aPgubZdd7Q;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct tySequence__E8pi9b5QNahsURYzXMjh3qw {
NI len; tySequence__E8pi9b5QNahsURYzXMjh3qw_Content* p;
};
struct tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q {
 tySequence__E8pi9b5QNahsURYzXMjh3qw data;
 NI counter;
};
struct tySequence__qwqHTkRvwhrRyENtudHQ7g {
NI len; tySequence__qwqHTkRvwhrRyENtudHQ7g_Content* p;
};
struct tyTuple__47w2DboNEPf69aPgubZdd7Q {
NI Field0;
NI Field1;
NI Field2;
};
struct NimStrPayload {
 NI cap;
 NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
 NI len;
 NimStrPayload* p;
};
struct tySequence__E8pi9b5QNahsURYzXMjh3qw_Content { NI cap; tyTuple__47w2DboNEPf69aPgubZdd7Q data[SEQ_DECL_SIZE]; };
struct tySequence__qwqHTkRvwhrRyENtudHQ7g_Content { NI cap; NI data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void);
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NI, len__temp_u59)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q t_p0);
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4608)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(void, add__temp_u365)(tySequence__qwqHTkRvwhrRyENtudHQ7g* x_p0, NI y_p1);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u254)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, alignedDealloc)(void* p_p0, NI align_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u554)(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q* dest_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[156+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 156 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/tables.nim(753, 13) `len(t) == L` the length of the table changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {156, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
static const struct {
NI cap; NIM_CHAR data[147+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_5 = { 147 | NIM_STRLIT_FLAG, "/home/runner/.choosenim/toolchains/nim-#devel/lib/system/iterators.nim(187, 11) `len(a) == L` the length of the seq changed while iterating over it" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_6 = {147, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_5};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4392;
extern NIM_THREADVAR TFrame* framePtr__system_u2688;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
 void* T1_;
 T1_ = (void*)0;
 T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
 NIM_BOOL* result;
 result = (&nimInErrorMode__system_u4392);
 return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
 nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 }BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
 {
  if (!(framePtr__system_u2688 == ((TFrame*) NIM_NIL))) goto LA3_;
  (*s_p0).calldepth = ((NI16)0);
 }
 goto LA1_;
LA3_: ;
 {
  (*s_p0).calldepth = (NI16)((*framePtr__system_u2688).calldepth + ((NI16)1));
 }
LA1_: ;
 (*s_p0).prev = framePtr__system_u2688;
 framePtr__system_u2688 = s_p0;
 {
  if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
  callDepthLimitReached__system_u4608();
 }
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
 framePtr__system_u2688 = (*framePtr__system_u2688).prev;
}
static N_INLINE(NIM_BOOL, isFilled__pureZcollectionsZtables_u31)(NI hcode_p0) {
 NIM_BOOL result;
 nimfr_("isFilled", "/home/runner/.choosenim/toolchains/nim-#devel/lib/pure/collections/hashcommon.nim");
 result = !((hcode_p0 == ((NI)0)));
 popFrame();
 return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___temp_u417)(tySequence__qwqHTkRvwhrRyENtudHQ7g dest_p0) {
 if (dest_p0.p && !(dest_p0.p->cap & NIM_STRLIT_FLAG)) {
alignedDealloc(dest_p0.p, NIM_ALIGNOF(NI));
}
}
N_LIB_PRIVATE N_NIMCALL(void, eqsink___temp_u426)(tySequence__qwqHTkRvwhrRyENtudHQ7g* dest_p0, tySequence__qwqHTkRvwhrRyENtudHQ7g src_p1) {
 if ((*dest_p0).p != src_p1.p) {	eqdestroy___temp_u417((*dest_p0));
 }
(*dest_p0).len = src_p1.len; (*dest_p0).p = src_p1.p;
}
N_LIB_PRIVATE N_NIMCALL(void, b__temp_u573)(void) {
NIM_BOOL* nimErr_;
 nimfr_("b", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 {
  tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q colontmp_;
  NI w;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  w = (NI)0;
  nimZeroMem((void*)(&colontmp_), sizeof(tyObject_Table__N1QEfmUd9bXirjyq9atLJC0Q));
  {
   tySequence__qwqHTkRvwhrRyENtudHQ7g colontmp__2;
   tySequence__qwqHTkRvwhrRyENtudHQ7g resultX60gensym2_;
   NI h;
   NI e;
   NI i;
   NI L_2;
   NI T18_;
   colontmp__2.len = 0; colontmp__2.p = NIM_NIL;
   resultX60gensym2_.len = 0; resultX60gensym2_.p = NIM_NIL;
   h = (NI)0;
   e = (NI)0;
   {
    NI* xX60gensym2_;
    NI L;
    xX60gensym2_ = (NI*)0;
    L = len__temp_u59(colontmp_);
    if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
    {
     NI h_2;
     NI colontmp__3;
     NI T5_;
     NI res;
     h_2 = (NI)0;
     colontmp__3 = (NI)0;
     T5_ = (colontmp_.data.len-1);
     colontmp__3 = T5_;
     res = ((NI)0);
     {
      while (1) {
       NI TM__SRd76hP9cMfCzdUO857UhQQ_4;
       if (!(res <= colontmp__3)) goto LA7;
       h_2 = ((NI) (res));
       {
        NIM_BOOL T10_;
        NI colontmpD_;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        T10_ = (NIM_BOOL)0;
        T10_ = isFilled__pureZcollectionsZtables_u31(colontmp_.data.p->data[h_2].Field0);
        if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        if (!T10_) goto LA11_;
        colontmpD_ = (NI)0;
        if (h_2 < 0 || h_2 >= colontmp_.data.len){ raiseIndexError2(h_2,colontmp_.data.len-1); goto BeforeRet_;
        }
        xX60gensym2_ = (&colontmp_.data.p->data[h_2].Field1);
        colontmpD_ = (*xX60gensym2_);
        add__temp_u365((&resultX60gensym2_), colontmpD_);
        {
         NI T15_;
         T15_ = (NI)0;
         T15_ = len__temp_u59(colontmp_);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
         if (!!((T15_ == L))) goto LA16_;
         failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_3);
         if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
        }
LA16_: ;
       }
LA11_: ;
       if (nimAddInt(res, ((NI)1), &TM__SRd76hP9cMfCzdUO857UhQQ_4)) { raiseOverflow(); goto BeforeRet_;
       };
       res = (NI)(TM__SRd76hP9cMfCzdUO857UhQQ_4);
      } LA7: ;
     }
    }
   }
   eqsink___temp_u426((&colontmp__2), resultX60gensym2_);
   i = ((NI)0);
   T18_ = colontmp__2.len;
   L_2 = T18_;
   {
    while (1) {
     if (!(i < L_2)) goto LA20;
     h = i;
     if (i < 0 || i >= colontmp__2.len){ raiseIndexError2(i,colontmp__2.len-1); goto BeforeRet_;
     }
     e = colontmp__2.p->data[i];
     i += ((NI)1);
     {
      NI T23_;
      T23_ = colontmp__2.len;
      if (!!((T23_ == L_2))) goto LA24_;
      failedAssertImpl__stdZassertions_u254(TM__SRd76hP9cMfCzdUO857UhQQ_6);
      if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
     }
LA24_: ;
    } LA20: ;
   }
   eqdestroy___temp_u417(colontmp__2);
  }
  w = ((NI)0);
  eqdestroy___temp_u554((&colontmp_));
 }
 }BeforeRet_: ;
 popFrame();
}
N_LIB_PRIVATE N_NIMCALL(void, y__temp_u572)(void) {
NIM_BOOL* nimErr_;
 nimfr_("y", "/home/runner/work/Nim/Nim/temp.nim");
{nimErr_ = nimErrorFlag();
 b__temp_u573();
 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();
 y__temp_u572();
 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
 BeforeRet_: ;
 nimTestErrorFlag();
 popFrame();
}
}

Stats

  • Started 2024-03-31T14:03:56
  • Finished 2024-03-31T14:03:56
  • Duration

AST

nnkStmtList.newTree(
  nnkImportStmt.newTree(
    nnkInfix.newTree(
      newIdentNode("/"),
      newIdentNode("std"),
      newIdentNode("tables")
    )
  ),
  nnkTemplateDef.newTree(
    newIdentNode("k"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("untyped"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        newIdentNode("untyped"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("result"),
          nnkBracketExpr.newTree(
            newIdentNode("seq"),
            nnkCall.newTree(
              newIdentNode("typeof"),
              newIdentNode("m")
            )
          ),
          newEmptyNode()
        )
      ),
      nnkForStmt.newTree(
        newIdentNode("x"),
        newIdentNode("m"),
        nnkStmtList.newTree(
          nnkCall.newTree(
            nnkDotExpr.newTree(
              newIdentNode("result"),
              newIdentNode("add")
            ),
            newIdentNode("x")
          )
        )
      ),
      newIdentNode("result")
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("g"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("int"),
      nnkIdentDefs.newTree(
        newIdentNode("m"),
        nnkBracketExpr.newTree(
          newIdentNode("Table"),
          newIdentNode("int"),
          newIdentNode("int")
        ),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkForStmt.newTree(
        newIdentNode("h"),
        newIdentNode("e"),
        nnkDotExpr.newTree(
          nnkDotExpr.newTree(
            newIdentNode("m"),
            newIdentNode("keys")
          ),
          newIdentNode("k")
        ),
        nnkStmtList.newTree(
          nnkDiscardStmt.newTree(
            newEmptyNode()
          )
        )
      ),
      nnkYieldStmt.newTree(
        newLit(0)
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("y"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newEmptyNode()
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("b"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("w"),
            nnkCall.newTree(
              newIdentNode("g"),
              nnkCall.newTree(
                newIdentNode("default"),
                nnkBracketExpr.newTree(
                  newIdentNode("Table"),
                  newIdentNode("int"),
                  newIdentNode("int")
                )
              )
            ),
            nnkStmtList.newTree(
              nnkDiscardStmt.newTree(
                newEmptyNode()
              )
            )
          )
        )
      ),
      nnkCall.newTree(
        newIdentNode("b")
      )
    )
  ),
  nnkCall.newTree(
    newIdentNode("y")
  )
)
??? ➡️ 🐛

Diagnostics

The commit that introduced the bug can not be found, but the bug is in the commits:

(Can not find the commit because Nim can not be re-built commit-by-commit to bisect).

Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 19.1
  • Created 2024-03-31T14:03:11Z
  • Comments 1
  • Commands 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

🤖 Bug found in 11 minutes bisecting 71 commits at 6 commits per second

@Araq Araq added the Status label Apr 2, 2024
@ringabout
Copy link
Member

@juancarlospaco

I think we need use git bisect to find the first good commit; see also https://stackoverflow.com/questions/15407075/how-could-i-use-git-bisect-to-find-the-first-good-commit

@ringabout
Copy link
Member

I have run a bisect locally, #22559 is the fix, which has been backported to version-2-0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Backporting/Fixed in Devel The issues can be solved via backporting Status
Projects
None yet
Development

No branches or pull requests

4 participants