mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mrb might be intialized incompletely from mrbc; close #457
This commit is contained in:
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user