summaryrefslogtreecommitdiffhomepage
path: root/src/vm.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-11-21 15:30:03 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-11-21 15:50:16 +0900
commit59e581ed7811fc2afdeb410481e79adfe99e5a6a (patch)
tree0146e66e7e3304890db8b953b1aa8216d692a79e /src/vm.c
parenta7bcbd8bdc0969fbb2ee4cf37070a68de69a4b5c (diff)
downloadmruby-59e581ed7811fc2afdeb410481e79adfe99e5a6a.tar.gz
mruby-59e581ed7811fc2afdeb410481e79adfe99e5a6a.zip
Fix infinite loop bug from `super` when method is prepended.
Diffstat (limited to 'src/vm.c')
-rw-r--r--src/vm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vm.c b/src/vm.c
index c87fa9dc6..73ab40712 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1590,7 +1590,10 @@ RETRY_TRY_BLOCK:
mrb_exc_set(mrb, exc);
goto L_RAISE;
}
- if (target_class->tt == MRB_TT_MODULE) {
+ if (target_class->flags & MRB_FL_CLASS_IS_PREPENDED) {
+ target_class = ci->target_class;
+ }
+ else if (target_class->tt == MRB_TT_MODULE) {
target_class = ci->target_class;
if (target_class->tt != MRB_TT_ICLASS) {
mrb_value exc = mrb_exc_new_lit(mrb, E_RUNTIME_ERROR, "superclass info lost [mruby limitations]");