diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-04-10 10:37:37 +0200 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-04-10 10:37:37 +0200 |
commit | 2d080a7fdfd2916e4723d19ba585a0f228118fb4 (patch) | |
tree | 1a4fbbe45dc6b83a44a1c827e13798dbcbcbe0fd /zend/callable.h | |
parent | 82ab3697a33e55591fe5b8c3c7fa8084424015f6 (diff) |
argument names are probably always hard coded strings, so no reason to copy them to std::string objects, and now we also fix a memory corruption issue (issue #75)
Diffstat (limited to 'zend/callable.h')
-rw-r--r-- | zend/callable.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/zend/callable.h b/zend/callable.h index 8f2fbef..9d7e69b 100644 --- a/zend/callable.h +++ b/zend/callable.h @@ -143,8 +143,8 @@ protected: void fill(zend_arg_info *info, const Argument &arg) const { // fill members - info->name = arg.name().c_str(); - info->name_len = arg.name().size(); + info->name = arg.name(); + info->name_len = ::strlen(arg.name()); #if PHP_VERSION_ID >= 50400 @@ -176,8 +176,8 @@ protected: #endif // this parameter is a regular type - info->class_name = arg.type() == Type::Object ? arg.classname().c_str() : nullptr; - info->class_name_len = arg.type() == Type::Object ? arg.classname().size() : 0; + info->class_name = arg.type() == Type::Object ? arg.classname() : nullptr; + info->class_name_len = arg.type() == Type::Object ? ::strlen(arg.classname()) : 0; info->allow_null = arg.allowNull(); info->pass_by_reference = arg.byReference(); } |