summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-18 05:05:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-18 05:05:36 +0000
commit3f025d2078157e895fdcf77e31bfe62351bf90b4 (patch)
tree886cb636611df665bbb7dbf1b62983b8ce1ec3a4 /parse.y
parent42cf6ee7530e312288ff78236f552e1b6d5ca341 (diff)
* parse.y (reg_compile_gen): obtain error info from errinfo.
* re.c (rb_reg_error_desc): make RegexpError for initialization error. * re.c (rb_reg_compile): return nil and set errinfo if error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index af4fa6f8d7..583bc45bdd 100644
--- a/parse.y
+++ b/parse.y
@@ -8115,7 +8115,8 @@ reg_compile_gen(struct parser_params* parser, const char *ptr, long len, int opt
VALUE rb_reg_compile(const char *, long, int);
VALUE re = rb_reg_compile(ptr, len, (options) & ~RE_OPTION_ONCE);
- if (TYPE(re) == T_STRING) {
+ if (NIL_P(re)) {
+ RB_GC_GUARD(re) = rb_obj_as_string(rb_errinfo());
compile_error(PARSER_ARG "%s", RSTRING_PTR(re));
return Qnil;
}