summaryrefslogtreecommitdiffstats
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
commit7e1abb20c0799a7e8b7fa5987c506543509ecf32 (patch)
tree886cb636611df665bbb7dbf1b62983b8ce1ec3a4 /parse.y
parent9c638d305bc926cfbb75f53ff467ff086199df15 (diff)
downloadruby-7e1abb20c0799a7e8b7fa5987c506543509ecf32.tar.gz
ruby-7e1abb20c0799a7e8b7fa5987c506543509ecf32.tar.xz
ruby-7e1abb20c0799a7e8b7fa5987c506543509ecf32.zip
* 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: http://svn.ruby-lang.org/repos/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 af4fa6f8d..583bc45bd 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;
}