ruby-changes:4019
From: ko1@a...
Date: Sat, 16 Feb 2008 20:13:59 +0900 (JST)
Subject: [ruby-changes:4019] akr - Ruby:r15509 (trunk): * re.c (match_inspect): avoid SEGV with MatchData.allocate.inspect.
akr 2008-02-16 20:13:47 +0900 (Sat, 16 Feb 2008)
New Revision: 15509
Modified files:
trunk/ChangeLog
trunk/re.c
Log:
* re.c (match_inspect): avoid SEGV with MatchData.allocate.inspect.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15509&r2=15508&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/re.c?r1=15509&r2=15508&diff_format=u
Index: re.c
===================================================================
--- re.c (revision 15508)
+++ re.c (revision 15509)
@@ -1510,6 +1510,10 @@
struct backref_name_tag *names;
VALUE regexp = RMATCH(match)->regexp;
+ if (regexp == 0) {
+ return rb_sprintf("#<%s:%p>", cname, (void*)match);
+ }
+
names = ALLOCA_N(struct backref_name_tag, num_regs);
MEMZERO(names, struct backref_name_tag, num_regs);
Index: ChangeLog
===================================================================
--- ChangeLog (revision 15508)
+++ ChangeLog (revision 15509)
@@ -1,3 +1,7 @@
+Sat Feb 16 20:12:47 2008 Tanaka Akira <akr@f...>
+
+ * re.c (match_inspect): avoid SEGV with MatchData.allocate.inspect.
+
Sat Feb 16 19:04:17 2008 NARUSE, Yui <naruse@r...>
* string.c (str_strlen): revert r15507. [ruby-dev:33810]
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/