com php-src: op_array->function_name, op_array->d oc_comments and op_array->filename may be kept in opcache SHM: ext/reflection/php_reflection.c
| From: | Dmitry Stogov | Date: | Wed, 16 Apr 2014 18:41:07 +0000 |
| Subject: | com php-src: op_array->function_name, op_array->d oc_comments and op_array->filename may be kept in opcache SHM: ext/reflection/php_reflection.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77370@lists.php.net to get a copy of this message | ||
Commit: cc576c74d2894abde062d1f41c8e309f9ec569a6
Author: Dmitry Stogov <dmitry@zend.com> Wed, 16 Apr 2014 22:41:07 +0400
Parents: 5bb493c40bb407203db2d4dd7b884310444a9d6c
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cc576c74d2894abde062d1f41c8e309f9ec569a6
Log:
op_array->function_name, op_array->doc_comments and op_array->filename may be kept in
opcache SHM
Changed paths:
M ext/reflection/php_reflection.c
Diff:
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 9aea15c..d080b81 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1800,7 +1800,8 @@ ZEND_METHOD(reflection_function, getFileName)
}
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type == ZEND_USER_FUNCTION) {
- RETURN_STR(STR_COPY(fptr->op_array.filename));
+// TODO: we have to duplicate it, becaise it may be in opcache SHM ???
+ RETURN_STR(STR_DUP(fptr->op_array.filename, 0));
}
RETURN_FALSE;
}
@@ -1854,7 +1855,8 @@ ZEND_METHOD(reflection_function, getDocComment)
}
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment) {
- RETURN_STR(STR_COPY(fptr->op_array.doc_comment));
+// TODO: we have to duplicate it, becaise it may be stored in opcache SHM ???
+ RETURN_STR(STR_DUP(fptr->op_array.doc_comment, 0));
}
RETURN_FALSE;
}
@@ -3566,7 +3568,8 @@ ZEND_METHOD(reflection_class, getFileName)
}
GET_REFLECTION_OBJECT_PTR(ce);
if (ce->type == ZEND_USER_CLASS) {
- RETURN_STR(STR_COPY(ce->info.user.filename));
+// TODO: we have to duplicate it, becaise it may be stored in opcache SHM ???
+ RETURN_STR(STR_DUP(ce->info.user.filename, 0));
}
RETURN_FALSE;
}