Permalink
Browse files

fix premature GC in rb_parser_compile_{string,file} by making sure th…

…e parser object remains on the stack
  • Loading branch information...
1 parent dbedf7c commit ea09ab2f04b76280efd63841b51e024b481710ed Laurent Sansonetti committed Jul 1, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 parse.y
View
@@ -5085,7 +5085,8 @@ rb_compile_string(const char *f, VALUE s, int line)
}
NODE *
-rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
+rb_parser_compile_string(volatile VALUE vparser, const char *f, VALUE s,
+ int line)
{
struct parser_params *parser;
Data_Get_Struct(vparser, struct parser_params, parser);
@@ -5133,7 +5134,7 @@ rb_compile_file(const char *f, VALUE file, int start)
}
NODE *
-rb_parser_compile_file(VALUE vparser, const char *f, VALUE file,
+rb_parser_compile_file(volatile VALUE vparser, const char *f, VALUE file,
int start)
{
struct parser_params *parser;

0 comments on commit ea09ab2

Please sign in to comment.