[ruamoko] Implement obj_calloc correctly

Forgetting to multiply by the second term leads to not good things.
This commit is contained in:
Bill Currie 2020-04-02 19:29:54 +09:00
parent 63caa5794d
commit 17871b979d

View file

@ -1489,7 +1489,7 @@ rua_obj_realloc (progs_t *pr)
static void static void
rua_obj_calloc (progs_t *pr) rua_obj_calloc (progs_t *pr)
{ {
int size = P_INT (pr, 0) * sizeof (pr_type_t); int size = P_INT (pr, 0) * P_INT (pr, 1) * sizeof (pr_type_t);
void *mem = PR_Zone_Malloc (pr, size); void *mem = PR_Zone_Malloc (pr, size);
memset (mem, 0, size); memset (mem, 0, size);