From aeed3beea26651761cda1831ef3ee1544bcbd689 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 19 Oct 2005 10:26:54 +0000 Subject: * parse.y (rb_gc_mark_parser): get rid of segfault with old yacc. fixed: [ruby-dev:27439] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 54b1dcebd..33c1b6a0e 100644 --- a/parse.y +++ b/parse.y @@ -2467,6 +2467,10 @@ terms : term none : /* none */ {$$ = 0;} ; %% +#ifdef yystacksize +#undef YYMALLOC +#endif + #include "regex.h" #include "util.h" @@ -5756,7 +5760,12 @@ ruby_parser_stack_on_heap() void rb_gc_mark_parser() { +#if defined YYMALLOC rb_gc_mark((VALUE)parser_heap); +#elif defined yystacksize + if (yyvsp) rb_gc_mark_locations((VALUE *)yyvs, (VALUE *)yyvsp); +#endif + if (!ruby_in_compile) return; rb_gc_mark_maybe((VALUE)yylval.node); -- cgit