Error out instead of crashing for vector out variables

This commit is contained in:
Ricardo Luís Vaz Silva 2022-12-18 15:43:54 -03:00 committed by Christoph Oelckers
parent 941c0850ba
commit fb33a29400

View file

@ -824,6 +824,10 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
assert(b < f->NumRegF); assert(b < f->NumRegF);
::new(param) VMValue(&reg.f[b]); ::new(param) VMValue(&reg.f[b]);
break; break;
case REGT_FLOAT | REGT_MULTIREG2 | REGT_ADDROF:
case REGT_FLOAT | REGT_MULTIREG3 | REGT_ADDROF:
case REGT_FLOAT | REGT_MULTIREG4 | REGT_ADDROF:
I_Error("REGT_ADDROF not implemented for vectors\n");
case REGT_FLOAT | REGT_KONST: case REGT_FLOAT | REGT_KONST:
assert(b < sfunc->NumKonstF); assert(b < sfunc->NumKonstF);
::new(param) VMValue(konstf[b]); ::new(param) VMValue(konstf[b]);