[macruby-changes] [2651] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Sat Sep 26 18:59:55 PDT 2009
Revision: 2651
http://trac.macosforge.org/projects/ruby/changeset/2651
Author: lsansonetti at apple.com
Date: 2009-09-26 18:59:55 -0700 (Sat, 26 Sep 2009)
Log Message:
-----------
let's try to work around the parser crash with a gruik technique
Modified Paths:
--------------
MacRuby/trunk/gc.c
MacRuby/trunk/parse.y
Modified: MacRuby/trunk/gc.c
===================================================================
--- MacRuby/trunk/gc.c 2009-09-27 00:56:11 UTC (rev 2650)
+++ MacRuby/trunk/gc.c 2009-09-27 01:59:55 UTC (rev 2651)
@@ -345,6 +345,9 @@
GC_WB(&n->u2.value, a1);
GC_WB(&n->u3.value, a2);
+ // FIXME this retain is added because the parser is NOT GC-safe at this point
+ GC_RETAIN(n);
+
return n;
}
@@ -364,7 +367,8 @@
void
rb_gc_force_recycle(VALUE p)
{
- xfree((void *)p);
+ // FIXME this xfree call is commented because it's used by the parser which is NOT GC-safe at this point
+// xfree((void *)p);
}
static int
Modified: MacRuby/trunk/parse.y
===================================================================
--- MacRuby/trunk/parse.y 2009-09-27 00:56:11 UTC (rev 2650)
+++ MacRuby/trunk/parse.y 2009-09-27 01:59:55 UTC (rev 2651)
@@ -6427,7 +6427,7 @@
else {
token = parse_string(lex_strterm);
if (token == tSTRING_END || token == tREGEXP_END) {
- //rb_gc_force_recycle((VALUE)lex_strterm);
+ rb_gc_force_recycle((VALUE)lex_strterm);
lex_strterm = 0;
lex_state = EXPR_ENDARG;
}
@@ -7710,7 +7710,7 @@
int t;
#if YYPURE
- parser->parser_yylval = (union tmpyystype*)lval;
+ GC_WB(&parser->parser_yylval, (union tmpyystype*)lval);
parser->parser_yylval->val = Qundef;
#endif
t = parser_yylex(parser);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090926/877915e8/attachment.html>
More information about the macruby-changes
mailing list