vm.c (stack_copy) check if src is NULL before memcpy(); ref
Because 2nd argument of memcpy() is declared to never be null.
@@ -102,8 +102,10 @@ stack_clear(mrb_value *from, size_t count)
static inline void
stack_copy(mrb_value *dst, const mrb_value *src, size_t size)
{
+ if (src) {
memcpy(dst, src, sizeof(mrb_value)*size);
}
+}
static void
stack_init(mrb_state *mrb)
