diff options
Diffstat (limited to 'template/prelude.c.tmpl')
-rw-r--r-- | template/prelude.c.tmpl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl index 428c9f4d01..ebf9bc0693 100644 --- a/template/prelude.c.tmpl +++ b/template/prelude.c.tmpl @@ -140,8 +140,8 @@ static rb_ast_t * prelude_ast(VALUE name, VALUE code, int line) { rb_ast_t *ast = rb_parser_compile_string_path(rb_parser_new(), name, code, line); - if (!ast->body.root) { - rb_ast_dispose(ast); + if (!ast || !ast->body.root) { + if (ast) rb_ast_dispose(ast); rb_exc_raise(rb_errinfo()); } return ast; @@ -208,7 +208,7 @@ Init_<%=init_name%><%=%>(void) %unless @prelude_count.zero? % preludes.each do |i, prelude, lines, sub, start_line| % next if sub - prelude_eval(PRELUDE_CODE(<%=i%><%=%>), PRELUDE_NAME(<%=i%><%=%>), <%=start_line%>); + prelude_eval(PRELUDE_CODE(<%=i%><%=%>), PRELUDE_NAME(<%=i%><%=%>), <%=start_line%><%=%>); % end #if 0 |