Commit 9e7ca5d9 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

mrb might be intialized incompletely from mrbc; close #457

parent fc52d2d6
......@@ -65,7 +65,7 @@ $(MLIB) : $(CLIB)
$(CLIB) : $(RLIB) $(MRBC)
$(MRBC) -Bmrblib_irep -o$(DLIB) $(RLIB); $(CAT) init_$(TARGET).c $(DLIB) > $@
$(MRBC) : ../src/opcode.h ../src/codegen.c ../src/parse.y
$(MRBC) : $(LIBR0)
$(MAKE) -C ../tools/mrbc $(MAKE_FLAGS)
# merge mruby sources
......
......@@ -51,14 +51,6 @@ end
class KeyError < IndexError
end
# ISO 15.2.37
class ScriptError < Exception
end
# ISO 15.2.38
class SyntaxError < ScriptError
end
class NotImplementedError < ScriptError
end
......@@ -407,4 +407,8 @@ mrb_init_exception(mrb_state *mrb)
mrb->eStandardError_class = mrb_define_class(mrb, "StandardError", mrb->eException_class); /* 15.2.23 */
mrb_define_class(mrb, "RuntimeError", mrb->eStandardError_class); /* 15.2.28 */
mrb_define_class(mrb, "RuntimeError", mrb->eStandardError_class); /* 15.2.28 */
e = mrb_define_class(mrb, "ScriptError", mrb->eException_class); /* 15.2.37 */
mrb_define_class(mrb, "SyntaxError", e); /* 15.2.38 */
}
......@@ -233,7 +233,7 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mr
struct RClass *c;
mrb_sym undef = 0;
mrb_callinfo *ci;
int n = mrb->ci->nregs;
int n;
mrb_value val;
if (!mrb->jmp) {
......@@ -250,6 +250,10 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mr
return val;
}
if (!mrb->stack) {
stack_init(mrb);
}
n = mrb->ci->nregs;
if (argc < 0) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "negative argc for funcall (%d)", argc);
}
......
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