Skip to content

Commit

Permalink
Fix problem in qhasharr
Browse files Browse the repository at this point in the history
  • Loading branch information
CatKang committed Nov 27, 2015
1 parent 38fd505 commit a2a56c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/qlibc/qhasharr.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ static void *_get_data(qhasharr_t *tbl, int idx, size_t *size)
qhasharr_init(tbl, &_tbl_slots);
int loop_count = 0;

for (newidx = idx, valsize = 0; ; newidx = _tbl_slots[newidx].link)
for (newidx = idx, valsize = 0; newidx != -1 ; newidx = _tbl_slots[newidx].link)
{
valsize += _tbl_slots[newidx].size;
if (_tbl_slots[newidx].link == -1) break;
Expand All @@ -851,7 +851,7 @@ static void *_get_data(qhasharr_t *tbl, int idx, size_t *size)
}
memset(value, 0, valsize);
loop_count = 0;
for (newidx = idx, vp = value; (size_t)(vp - value) < valsize; newidx = _tbl_slots[newidx].link)
for (newidx = idx, vp = value; (size_t)(vp - value) < valsize && newidx != -1; newidx = _tbl_slots[newidx].link)
{
uint8_t vsize = _tbl_slots[newidx].size;
if ((size_t)(vp - value + vsize) > valsize)
Expand Down

2 comments on commit a2a56c3

@xianhuawei
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

咱的Qconf 什么时候支持php7 啊?

@monque
Copy link
Contributor

@monque monque commented on a2a56c3 Dec 16, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.