summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-19 10:26:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-19 10:26:54 +0000
commitd53ad837dde3b6a29cefa9e209ad2d9af26be5c9 (patch)
treebc2c91136a202ffe99fff45cb3bf2efe562e52c5
parentaa9c627fd2ecb9d9f48e7aebe21f6b19eb7b614e (diff)
* parse.y (rb_gc_mark_parser): get rid of segfault with old yacc.
fixed: [ruby-dev:27439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--parse.y9
2 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index a729018..2f3af68 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Oct 19 19:26:15 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (rb_gc_mark_parser): get rid of segfault with old yacc.
+ fixed: [ruby-dev:27439]
+
Wed Oct 19 08:28:32 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_join): elements may contain null pointer strings.
diff --git a/parse.y b/parse.y
index 54b1dce..33c1b6a 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);