fix refcounts

This commit is contained in:
dzaima 2021-06-29 22:58:32 +03:00
parent 1fd61c5467
commit 84f58a2f87
2 changed files with 3 additions and 3 deletions

View File

@ -105,7 +105,7 @@ NOINLINE Block* bqn_comp(B str, B path, B args) { // consumes all
comp_currArgs = args;
comp_currSrc = str;
comp_envPos = envCurr-envStart;
Block* r = load_compObj(c2(load_comp, inc(load_compArg), inc(str)), str, inc(path), NULL);
Block* r = load_compObj(c2(load_comp, inc(load_compArg), inc(str)), str, path, NULL);
dec(path); dec(args);
comp_currPath = comp_currArgs = comp_currSrc = bi_N;
return r;
@ -134,7 +134,7 @@ NOINLINE Block* bqn_compSc(B str, B path, B args, Scope* sc, bool repl) { // con
csc = csc->psc;
depth++;
}
Block* r = load_compObj(c2(load_comp, m_v4(inc(load_rtObj), inc(bi_sys), vName, vDepth), inc(str)), str, inc(path), sc);
Block* r = load_compObj(c2(load_comp, m_v4(inc(load_rtObj), inc(bi_sys), vName, vDepth), inc(str)), str, path, sc);
dec(path); dec(args);
comp_currPath = comp_currArgs = comp_currSrc = bi_N;
return r;

View File

@ -9,7 +9,7 @@ static bool init = false;
static void repl_init() {
if (init) return;
cbqn_init();
replPath = m_str32(U""); gc_add(replPath);
replPath = inc(bi_emptyCVec); gc_add(replPath);
Block* initBlock = bqn_comp(m_str32(U"\"(REPL initializer)\""), inc(replPath), m_f64(0));
gsc = m_scope(initBlock->body, NULL, 0, 0, NULL); gc_add(tag(gsc,OBJ_TAG));
ptr_dec(initBlock);