Skip to content

Commit

Permalink
vm.c: check if target_class is NULL (when prepended).
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Apr 21, 2022
1 parent bdc244e commit a4d9793
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/vm.c
Expand Up @@ -1750,10 +1750,7 @@ mrb_vm_exec(mrb_state *mrb, const struct RProc *proc, const mrb_code *pc)
mrb_exc_set(mrb, exc);
goto L_RAISE;
}
if (target_class->flags & MRB_FL_CLASS_IS_PREPENDED) {
target_class = mrb_vm_ci_target_class(ci);
}
else if (target_class->tt == MRB_TT_MODULE) {
if ((target_class->flags & MRB_FL_CLASS_IS_PREPENDED) || target_class->tt == MRB_TT_MODULE) {
target_class = mrb_vm_ci_target_class(ci);
if (!target_class || target_class->tt != MRB_TT_ICLASS) {
goto super_typeerror;
Expand Down

0 comments on commit a4d9793

Please sign in to comment.