-Subproject commit cef9b411504a524d73b2e282de45bbd30fd22751
+Subproject commit 88fdb929584524f29d8eeb23b0fc7afd80fd57ee
end = ARRAY_LEN(in) + end;
const m_int op = start < end ? 1 : -1;
const m_uint sz = op > 0 ? end - start : start - end;
- if(bounds(in, start) < 0 || bounds(in, end) < 0)
+ if(bounds(in, start) < 0 || bounds(in, end) < 0) {
handle(shred, "OutOfBoundsArraySliceException");
+ return;
+ }
const M_Object out = new_array(shred->info->vm->gwion->mp, array->type_ref, sz);
for(m_int i = start, j = 0; i != end; i += op, ++j) {
m_bit buf[ARRAY_SIZE(in)];
INSTR(GTmpl) {
struct dottmpl_ *dt = (struct dottmpl_*)instr->m_val;
const Func f = *(Func*)REG(-SZ_INT);
- if(!f)
+ if(!f) {
handle(shred, "EmptyFuncPointerException");
-if(f->code) {
- *(VM_Code*)(shred->reg -SZ_INT) = f->code;
- return;
-}
+ return;
+ }
+ if(f->code) {
+ *(VM_Code*)(shred->reg -SZ_INT) = f->code;
+ return;
+ }
const m_str name = f->name;
const Emitter emit = shred->info->vm->gwion->emit;
emit->env->name = "runtime";
free_mstr(emit->gwion->mp, tmpl_name);
dt->def = f->def;
const Func_Def def = traverse_tmpl(emit, dt, f->value_ref->from->owner);
- if(!def)
+ if(def)
+ *(VM_Code*)(shred->reg -SZ_INT) = def->base->func->code;
+ else
handle(shred, "MissigTmplPtrException");
- *(VM_Code*)(shred->reg -SZ_INT) = def->base->func->code;
}
INSTR(DotTmpl) {
const m_uint offset = !instr->m_val ? SZ_INT : 0;
shred->reg -= SZ_INT*2 - offset;
const M_Object o = *(M_Object*)(shred->reg + SZ_INT - offset);
- if(!o)
+ if(!o) {
handle(shred, "NullPtrException");
+ return;
+ }
struct UUGen_ *uu = UGEN(o)->module.gen.data;
- if(uu->shred)
+ if(uu->shred) {
free_vm_shred(uu->shred);
+ return;
+ }
UGEN(o)->module.gen.tick = usrugen_tick;
const VM_Code code = *(VM_Code*)(shred->reg-offset);
- if(!code)
+ if(!code) {
handle(shred, "NullTickException");
+ return;
+ }
uu->shred = new_vm_shred(shred->info->vm->gwion->mp, *(VM_Code*)(shred->reg-offset));
vmcode_addref(*(VM_Code*)(shred->reg - offset));
uu->shred->info->vm = shred->info->vm;
static INSTR(instr_ptr_deref) {
const m_bit *o = *(m_bit**)REG(-SZ_INT);
- if(!o)
+ if(!o) {
handle(shred, _("EmptyPointerException"));
+ return;
+ }
if(instr->m_val2)
memcpy(REG(-SZ_INT), &o, SZ_INT);
else {
m_int end = *(m_uint*)REG(SZ_INT);
if(end < 0)
end = strsz + end;
- if(bounds(str, start) < 0 || bounds(str, end) < 0)
+ if(bounds(str, start) < 0 || bounds(str, end) < 0) {
handle(shred, "OutOfBoundsStringSlice");
+ return;
+ }
const m_int op = start < end ? 1 : -1;
const m_uint sz = op > 0 ? end - start : start - end;
char c[sz + 1];
if(!UGEN(rhs)->module.gen.trig) { \
release_connect(shred); \
handle(shred, "NonTriggerException"); \
+ return; \
}
#define describe_connect_instr(name, func, tgt, opt) \
static INSTR(name##func) { \
static INSTR(VarargCast) {
const M_Object o = *(M_Object*)REG(-SZ_INT);
- if(!*(m_uint*)(o->data + SZ_INT))
+ if(!*(m_uint*)(o->data + SZ_INT)) {
handle(shred, "Using Vararg outside varloop");
+ return;
+ }
struct Vararg_* arg = *(struct Vararg_**)o->data;
const Type t = (Type)instr->m_val,
u = (Type)vector_at(&arg->t, *(m_uint*)(o->data + SZ_INT*4));