[macruby-changes] [2524] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Wed Sep 9 00:10:00 PDT 2009
Revision: 2524
http://trac.macosforge.org/projects/ruby/changeset/2524
Author: lsansonetti at apple.com
Date: 2009-09-09 00:09:55 -0700 (Wed, 09 Sep 2009)
Log Message:
-----------
fixed AOT compilation of literal regexp to retain the objects
Modified Paths:
--------------
MacRuby/trunk/compiler.cpp
MacRuby/trunk/re.c
Modified: MacRuby/trunk/compiler.cpp
===================================================================
--- MacRuby/trunk/compiler.cpp 2009-09-09 03:06:04 UTC (rev 2523)
+++ MacRuby/trunk/compiler.cpp 2009-09-09 07:09:55 UTC (rev 2524)
@@ -5119,7 +5119,7 @@
RubyObjTy, PtrTy, NULL));
Function *newRegexp2Func =
- cast<Function>(module->getOrInsertFunction("rb_reg_new",
+ cast<Function>(module->getOrInsertFunction("rb_reg_new_retained",
RubyObjTy, PtrTy, Type::Int32Ty, Type::Int32Ty, NULL));
Function *getClassFunc =
Modified: MacRuby/trunk/re.c
===================================================================
--- MacRuby/trunk/re.c 2009-09-09 03:06:04 UTC (rev 2523)
+++ MacRuby/trunk/re.c 2009-09-09 07:09:55 UTC (rev 2524)
@@ -2703,6 +2703,14 @@
}
VALUE
+rb_reg_new_retained(const char *s, long len, int options)
+{
+ VALUE re = rb_reg_new(s, len, options);
+ GC_RETAIN(re);
+ return re;
+}
+
+VALUE
rb_reg_compile(VALUE str, int options)
{
VALUE re = rb_reg_s_alloc(rb_cRegexp, 0);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090909/007e47b6/attachment.html>
More information about the macruby-changes
mailing list