diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-06-11 11:10:31 +0200 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-06-11 11:10:31 +0200 |
commit | b17b09c3b482f51a842f5272e88a7ed2820a1925 (patch) | |
tree | 3c57aacf9820805c669c3a22227d0ec57cdd5c1b /zend/value.cpp | |
parent | b4936cbc31c20c390d50333da5c83ff31795acf7 (diff) |
issue #93: fix crash when moving to null Php::Value object
Diffstat (limited to 'zend/value.cpp')
-rw-r--r-- | zend/value.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zend/value.cpp b/zend/value.cpp index 7fc45d6..7592f57 100644 --- a/zend/value.cpp +++ b/zend/value.cpp @@ -403,7 +403,7 @@ Value &Value::operator=(Value &&value) if (this == &value) return *this; // is the object a reference? - if (Z_ISREF_P(_val)) + if (_val && Z_ISREF_P(_val)) { // @todo difference if the other object is a reference or not? @@ -449,7 +449,7 @@ Value &Value::operator=(Value &&value) { // destruct the zval (this function will decrement the reference counter, // and only destruct if there are no other references left) - zval_ptr_dtor(&_val); + if (_val) zval_ptr_dtor(&_val); // just copy the zval completely _val = value._val; |