summaryrefslogtreecommitdiff
path: root/zend
diff options
context:
space:
mode:
authorMartijn Otto <martijn.otto@copernica.com>2015-05-07 13:10:13 +0200
committerMartijn Otto <martijn.otto@copernica.com>2015-05-07 13:10:13 +0200
commit7c2cd609dc7ca0391094b3f27d296f23bfcaaf10 (patch)
tree5a94c0a1f8353bc6d6903efc790f09ce2921a115 /zend
parentb554b4d7c604c12c7988d0ea17ca666e2097ab00 (diff)
rawValue no longer tries to return a valid pointer when the Value object does not represent a string value
Diffstat (limited to 'zend')
-rw-r--r--zend/value.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/zend/value.cpp b/zend/value.cpp
index 67bead3..d96ac57 100644
--- a/zend/value.cpp
+++ b/zend/value.cpp
@@ -1282,7 +1282,9 @@ char *Value::reserve(size_t size)
}
/**
- * Access to the raw buffer
+ * Get access to the raw buffer for read operations. Note that this
+ * only works for string variables - other variables return nullptr.
+ *
* @return const char *
*/
const char *Value::rawValue() const
@@ -1290,8 +1292,8 @@ const char *Value::rawValue() const
// must be a string
if (isString()) return Z_STRVAL_P(_val);
- // make a clone and return that buffer
- return clone(Type::String).rawValue();
+ // there is no raw value
+ return nullptr;
}
/**