summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-24 08:47:36 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-24 08:47:36 +0000
commite9e100aa48cfc43a588ee411e1fbb861de956587 (patch)
tree76c9cdce61ad6204b3c7509f5a612de21404f19c /regex.c
parent932075e82e1879bb0258bccd607c4c30b9ff486d (diff)
* eval.c (catch_timer): do not call rb_thread_schedule() inside to
avoid pthread_mutex_lock() deadlock. interrupts to system calls are detected by TRAP_END via EINTR error. * eval.c (thread_timer): do not post signal unless it is absolutely necessary. * rubysig.h (TRAP_END): add CHECK_INTS to switch thread. * regex.c (re_compile_pattern): check if nextp is smaller than pend. [ruby-dev:22372] * eval.c (umethod_bind): remove method overridden check. [ruby-dev:22366] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/regex.c b/regex.c
index d684eca835..7db560bb98 100644
--- a/regex.c
+++ b/regex.c
@@ -2373,9 +2373,10 @@ re_compile_pattern(pattern, size, bufp)
nextp = p + mbclen(c) - 1;
if (!pending_exact || pending_exact + *pending_exact + 1 != b
|| *pending_exact >= (c1 ? 0176 : 0177)
- || *nextp == '+' || *nextp == '?'
- || *nextp == '*' || *nextp == '^'
- || *nextp == '{') {
+ || (nextp < pend &&
+ ( *nextp == '+' || *nextp == '?'
+ || *nextp == '*' || *nextp == '^'
+ || *nextp == '{'))) {
laststart = b;
BUFPUSH(exactn);
pending_exact = b;