summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-05 03:04:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-05 03:04:52 +0000
commit3718713689769e4b8262743b562cfc16d883e24b (patch)
treed600866989f9079023aa5ecab58c582b60edf252
parent7b0a45869cfc638f1076b7fff8d89240439b33ca (diff)
downloadruby-3718713689769e4b8262743b562cfc16d883e24b.tar.gz
ruby-3718713689769e4b8262743b562cfc16d883e24b.tar.xz
ruby-3718713689769e4b8262743b562cfc16d883e24b.zip
* re.c (rb_reg_s_alloc): avoid inifinte recursion.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--re.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/re.c b/re.c
index 06a4b39be..112161589 100644
--- a/re.c
+++ b/re.c
@@ -1045,13 +1045,14 @@ static VALUE
rb_reg_s_alloc(klass)
VALUE klass;
{
- VALUE re = rb_obj_alloc(klass);
+ NEWOBJ(re, struct RRegexp);
+ OBJSETUP(re, klass, T_REGEXP);
- RREGEXP(re)->ptr = 0;
- RREGEXP(re)->len = 0;
- RREGEXP(re)->str = 0;
+ re->ptr = 0;
+ re->len = 0;
+ re->str = 0;
- return re;
+ return (VALUE)re;
}
static VALUE