Skip to content

Commit

Permalink
RB_GC_GUARD
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Apr 30, 2024
1 parent d38252c commit 6791f2d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions iseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,7 @@ iseqw_s_compile_file(int argc, VALUE *argv, VALUE self)

rb_vm_pop_frame(ec);
RB_GC_GUARD(v);
RB_GC_GUARD(vast);
return ret;
}

Expand Down
1 change: 1 addition & 0 deletions load.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ load_iseq_eval(rb_execution_context_t *ec, VALUE fname)
iseq = rb_iseq_new_top(&ast->body, rb_fstring_lit("<top (required)>"),
fname, realpath_internal_cached(realpath_map, fname), NULL);
rb_ast_dispose(ast);
RB_GC_GUARD(vast);
}

rb_vm_pop_frame(ec);
Expand Down
2 changes: 2 additions & 0 deletions mini_builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ builtin_iseq_load(const char *feature_name, const struct rb_builtin_function *ta
rb_vm_register_global_object((VALUE)iseq);
#endif

RB_GC_GUARD(vast);

return iseq;
}

Expand Down
2 changes: 2 additions & 0 deletions vm_eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,8 @@ eval_make_iseq(VALUE src, VALUE fname, int line,
rb_exec_event_hook_script_compiled(GET_EC(), iseq, src);
}

RB_GC_GUARD(vast);

return iseq;
}

Expand Down

0 comments on commit 6791f2d

Please sign in to comment.