Skip to content

Commit

Permalink
Prohibit changing generational mode during GC disabled; fix #3689
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Jun 3, 2017
1 parent 935649b commit c9a4f8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gc.c
Expand Up @@ -1437,7 +1437,7 @@ static void
change_gen_gc_mode(mrb_state *mrb, mrb_gc *gc, mrb_bool enable) change_gen_gc_mode(mrb_state *mrb, mrb_gc *gc, mrb_bool enable)
{ {
if (gc->disabled || gc->iterating) { if (gc->disabled || gc->iterating) {
gc->generational = enable; mrb_raise(mrb, E_RUNTIME_ERROR, "generational mode changed when GC disabled");
return; return;
} }
if (is_generational(gc) && !enable) { if (is_generational(gc) && !enable) {
Expand Down

0 comments on commit c9a4f8a

Please sign in to comment.