Skip to content

Commit

Permalink
Ensure you can safely call ZVal.ToPhp on a non-empty ZVal without lea…
Browse files Browse the repository at this point in the history
…king.
  • Loading branch information
cscott committed Nov 1, 2015
1 parent 4a2ec02 commit e0b7a99
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ class Value {
}
// Caller owns the ZVal, and is responsible for freeing it.
inline void ToPhp(PhpObjectMapper *m, ZVal &z TSRMLS_DC) const {
if (!z.IsNull()) { z.SetNull(); /* deallocate previous value */ }
ToPhp(m, z.Ptr(), z.PtrPtr() TSRMLS_CC);
}
inline bool IsEmpty() const {
Expand Down

0 comments on commit e0b7a99

Please sign in to comment.