* re.c (match_inspect): avoid SEGV with MatchData.allocate.inspect.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bb831578c5
commit
60fa63b819
@ -1,3 +1,7 @@
|
|||||||
|
Sat Feb 16 20:12:47 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* re.c (match_inspect): avoid SEGV with MatchData.allocate.inspect.
|
||||||
|
|
||||||
Sat Feb 16 19:04:17 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
Sat Feb 16 19:04:17 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* string.c (str_strlen): revert r15507. [ruby-dev:33810]
|
* string.c (str_strlen): revert r15507. [ruby-dev:33810]
|
||||||
|
4
re.c
4
re.c
@ -1510,6 +1510,10 @@ match_inspect(VALUE match)
|
|||||||
struct backref_name_tag *names;
|
struct backref_name_tag *names;
|
||||||
VALUE regexp = RMATCH(match)->regexp;
|
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);
|
names = ALLOCA_N(struct backref_name_tag, num_regs);
|
||||||
MEMZERO(names, struct backref_name_tag, num_regs);
|
MEMZERO(names, struct backref_name_tag, num_regs);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user