summaryrefslogtreecommitdiff
path: root/regparse.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-26 14:32:54 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-26 14:32:54 (GMT)
commita77ea177fe6609137c677d2c33453467eaea30df (patch)
tree9a0a8b47d5c5328a86eb6544868876969c9a6f64 /regparse.c
parent6a8d0097095d975fbd19cf62c83645b51886025b (diff)
* regparse.c (add_code_range_to_buf0): wrong condition of duplicated
warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regparse.c')
-rw-r--r--regparse.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/regparse.c b/regparse.c
index 183d1ff..08ffa80 100644
--- a/regparse.c
+++ b/regparse.c
@@ -1776,13 +1776,18 @@ add_code_range_to_buf0(BBuf** pbuf, ScanEnv* env, OnigCodePoint from, OnigCodePo
else
bound = x;
}
+ /* data[(low-1)*2+1] << from <= data[low*2]
+ * data[(high-1)*2+1] <= to << data[high*2]
+ */
inc_n = low + 1 - high;
if (n + inc_n > ONIG_MAX_MULTI_BYTE_RANGES_NUM)
return ONIGERR_TOO_MANY_MULTI_BYTE_RANGES;
if (inc_n != 1) {
- if (checkdup && to >= data[low*2]) CC_DUP_WARN(env);
+ if (checkdup && from <= data[low*2+1]
+ && (data[low*2] <= from || data[low*2+1] <= to))
+ CC_DUP_WARN(env);
if (from > data[low*2])
from = data[low*2];
if (to < data[(high - 1)*2 + 1])