summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-11 20:52:51 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-11 20:52:51 (GMT)
commit67e11229ecf10efeb1b7eb15b114bc783453b8a6 (patch)
tree73f41518d36e9ada702018209b4c4a0b9c6cade8
parent5e4d54a98dc8f61e4de1e24da74407751d99e437 (diff)
* regparse.c (fetch_token): warn invalid back reference
and subexp call. (\k and \g). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--regparse.c12
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 83d876b..63ac6b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Oct 12 05:51:11 2009 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regparse.c (fetch_token): warn invalid back reference
+ and subexp call. (\k and \g).
+
Mon Oct 12 03:47:42 2009 NARUSE, Yui <naruse@ruby-lang.org>
* marshal.c (has_encoding): added for check the regexp
diff --git a/regparse.c b/regparse.c
index 0cc9a62..9f46b15 100644
--- a/regparse.c
+++ b/regparse.c
@@ -3585,8 +3585,10 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
}
}
}
- else
- PUNFETCH;
+ else {
+ PUNFETCH;
+ onig_syntax_warn(env, "invalid back reference");
+ }
}
break;
#endif
@@ -3608,8 +3610,10 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
tok->u.call.name_end = name_end;
tok->u.call.gnum = gnum;
}
- else
- PUNFETCH;
+ else {
+ onig_syntax_warn(env, "invalid subexp call");
+ PUNFETCH;
+ }
}
break;
#endif