fix erroring variable read

This commit is contained in:
dzaima 2023-05-22 00:11:21 +03:00
parent e8caed529c
commit f0744f16d0
2 changed files with 7 additions and 4 deletions

View File

@ -604,10 +604,9 @@ NOINLINE B v_getF(Scope* pscs[], B s) {
VTY(s, t_harr);
usz ia = IA(s);
B* sp = harr_ptr(s);
HArr_p r = m_harrUv(ia);
for (u64 i = 0; i < ia; i++) r.a[i] = v_get(pscs, sp[i], true);
NOGC_E;
return r.b;
M_HARR(r, ia);
for (u64 i = 0; i < ia; i++) HARR_ADD(r, i, v_get(pscs, sp[i], true));
return HARR_FV(r);
} else if (isExt(s)) {
Scope* sc = pscs[V_DEPTH(s)];
B r = sc->ext->vars[V_POS(s)];
@ -1724,6 +1723,7 @@ NOINLINE void freeThrown() {
}
NOINLINE NORETURN void thrM(char* s) {
NOGC_CHECK("throwing during noAlloc");
thr(utf8Decode0(s));
}
NOINLINE NORETURN void thrOOM() {

View File

@ -33,6 +33,9 @@ a←"zero"‿"one" ⋄ !a≡a⊸{𝕩?1⊑𝕨;0⊑𝕨}¨0‿1
!"↩: Reading variable that hasn't been set" % {a10} a2
!"↩: Updating variable that hasn't been set" % {a10} a2
!"↩: Reading variable that hasn't been set" % {a (10)˙} a2
!"↩: Reading variable that hasn't been set" % a1 {ab2} b2
!"↩: Updating variable that hasn't been set" % a1 {ab2} b2
!"↩: Reading variable that hasn't been set" % a1 {ab (10)˙} b2
!"Assignment: Mismatched shape for spread assignment" % ab1
!"Assignment: Mismatched shape for spread assignment" % ab123
!"Assignment: Mismatched shape for spread assignment" % a<1