summaryrefslogtreecommitdiffstats
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
commitd00b5fd390da24d355097efa8ae5328c0bc644cb (patch)
tree76c9cdce61ad6204b3c7509f5a612de21404f19c /regex.c
parent0404061f8c5e259452491ed9fe5f26b71af4aed2 (diff)
downloadruby-d00b5fd390da24d355097efa8ae5328c0bc644cb.tar.gz
ruby-d00b5fd390da24d355097efa8ae5328c0bc644cb.tar.xz
ruby-d00b5fd390da24d355097efa8ae5328c0bc644cb.zip
* 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: http://svn.ruby-lang.org/repos/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 d684eca83..7db560bb9 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;