Commit a10d36e0 authored by Satoshi Odawara's avatar Satoshi Odawara

target_class should not be TT_ICLASS in instance_eval(string); ref #1152

parent b090f432
#include "mruby.h"
#include "mruby/class.h"
#include "mruby/compile.h"
#include "mruby/irep.h"
#include "mruby/proc.h"
......@@ -197,6 +198,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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment