vm.c: should check type before hash access.

Since the operand of double splat (`**`) may not be a hash, simple
assertion (previous code since d42a64ea) was not enough for this case.
parent ecb28f4b
......@@ -2766,7 +2766,7 @@ RETRY_TRY_BLOCK:
int lim = a+b*2+1;
hash = regs[a];
mrb_assert(mrb_hash_p(hash));
mrb_ensure_hash_type(mrb, hash);
for (i=a+1; i<lim; i+=2) {
mrb_hash_set(mrb, hash, regs[i], regs[i+1]);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment