[ruamoko] Check self is within progs memory

Changes a segfault to a runtime error, which beats the risk of self
pointing somewhere that doesn't segrault.
This commit is contained in:
Bill Currie 2022-01-31 14:03:36 +09:00
parent edf7a781fd
commit c5ae1ae13c

View file

@ -1536,6 +1536,9 @@ rua_obj_msgSend (progs_t *pr)
R_INT (pr) = P_INT (pr, 0);
return;
}
if (P_UINT (pr, 0) >= pr->globals_size) {
PR_RunError (pr, "invalid self: %x", P_UINT (pr, 0));
}
if (!_cmd)
PR_RunError (pr, "null selector");
imp = obj_msg_lookup (probj, self, _cmd);