mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #2599 from SatoshiOdawara/fix_target_class_in_instance_eval
target_class should not be TT_ICLASS in instance_eval(string); ref #1152
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "mruby.h"
|
||||
#include "mruby/class.h"
|
||||
#include "mruby/compile.h"
|
||||
#include "mruby/irep.h"
|
||||
#include "mruby/proc.h"
|
||||
@@ -206,6 +207,9 @@ f_instance_eval(mrb_state *mrb, mrb_value self)
|
||||
|
||||
mrb_get_args(mrb, "s|zi", &s, &len, &file, &line);
|
||||
mrb->c->ci->acc = CI_ACC_SKIP;
|
||||
if (mrb->c->ci->target_class->tt == MRB_TT_ICLASS) {
|
||||
mrb->c->ci->target_class = mrb->c->ci->target_class->c;
|
||||
}
|
||||
return mrb_run(mrb, create_proc_from_string(mrb, s, len, mrb_nil_value(), file, line), self);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user