Skip to content

Commit a4d9793

Browse files
committed
vm.c: check if target_class is NULL (when prepended).
1 parent bdc244e commit a4d9793

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Diff for: src/vm.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -1750,10 +1750,7 @@ mrb_vm_exec(mrb_state *mrb, const struct RProc *proc, const mrb_code *pc)
17501750
mrb_exc_set(mrb, exc);
17511751
goto L_RAISE;
17521752
}
1753-
if (target_class->flags & MRB_FL_CLASS_IS_PREPENDED) {
1754-
target_class = mrb_vm_ci_target_class(ci);
1755-
}
1756-
else if (target_class->tt == MRB_TT_MODULE) {
1753+
if ((target_class->flags & MRB_FL_CLASS_IS_PREPENDED) || target_class->tt == MRB_TT_MODULE) {
17571754
target_class = mrb_vm_ci_target_class(ci);
17581755
if (!target_class || target_class->tt != MRB_TT_ICLASS) {
17591756
goto super_typeerror;

0 commit comments

Comments
 (0)