mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
variable.c: skip const_added hook during bootstrapping; fix #6613
dd96afd added const_added hook call to mrb_const_set(), but calling
mrb_funcall_argv() during core initialization (before bootstrapping
completes) fails on bare metal platforms where VM is not fully ready.
skip hook during mrb->bootstrapping phase, matching pattern used in
class.c for method cache clearing.
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
+4
-2
@@ -1065,8 +1065,10 @@ mrb_const_set(mrb_state *mrb, mrb_value mod, mrb_sym sym, mrb_value v)
|
||||
}
|
||||
mrb_obj_iv_set(mrb, mrb_obj_ptr(mod), sym, v);
|
||||
|
||||
mrb_value name = mrb_symbol_value(sym);
|
||||
mrb_funcall_argv(mrb, mod, MRB_SYM(const_added), 1, &name);
|
||||
if (!mrb->bootstrapping) {
|
||||
mrb_value name = mrb_symbol_value(sym);
|
||||
mrb_funcall_argv(mrb, mod, MRB_SYM(const_added), 1, &name);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user