diff options
author | kosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-29 10:55:27 +0000 |
---|---|---|
committer | kosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-29 10:55:27 +0000 |
commit | ab984108d7f37ecd70e7d51b819a2f996d3ec834 (patch) | |
tree | b5f3e4fed3126a95151b254838652638b3aca326 /regexec.c | |
parent | 92d805753bf9264d35bb6ac44a740f71898654ab (diff) |
fix offset value in STATE_CHECK_BUFF_INIT()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -390,7 +390,8 @@ typedef struct { #define STATE_CHECK_BUFF_INIT(msa, str_len, offset, state_num) do { \ if ((state_num) > 0 && str_len >= STATE_CHECK_STRING_THRESHOLD_LEN) {\ - int size = ((int )((str_len) + 1) * (state_num) + 7) / 8;\ + unsigned int size = (unsigned int )(((str_len) + 1) * (state_num) + 7) >> 3;\ + offset = ((offset) * (state_num)) >> 3;\ if (size > 0 && offset < size && size < STATE_CHECK_BUFF_MAX_SIZE) {\ if (size >= STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE) \ (msa).state_check_buff = (void* )xmalloc(size);\ |