Skip to content

Commit

Permalink
Fix bug where HphpArray::lvalPtr returned pointer to wrong data
Browse files Browse the repository at this point in the history
  • Loading branch information
sgolemon committed Jul 24, 2012
1 parent e2a825d commit 8e09ecc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/base/array/hphp_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ ArrayData *HphpArray::lvalPtr(CStrRef k, Variant*& ret, bool copy,
} else {
ssize_t /*ElmInd*/ pos = t->find(key->data(), key->size(), prehash);
if (pos != (ssize_t)ElmIndEmpty) {
Elm* e = &m_data[pos];
Elm* e = &t->m_data[pos];
ret = &tvAsVariant(&e->data);
} else {
ret = NULL;
Expand All @@ -1316,7 +1316,7 @@ ArrayData *HphpArray::lvalPtr(int64 k, Variant*& ret, bool copy,
} else {
ElmInd pos = t->find(k);
if (pos != ElmIndEmpty) {
Elm* e = &m_data[pos];
Elm* e = &t->m_data[pos];
ret = &tvAsVariant(&e->data);
} else {
ret = NULL;
Expand Down

0 comments on commit 8e09ecc

Please sign in to comment.