From cc576c74d2894abde062d1f41c8e309f9ec569a6 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 16 Apr 2014 22:41:07 +0400 Subject: [PATCH] op_array->function_name, op_array->doc_comments and op_array->filename may be kept in opcache SHM --- ext/reflection/php_reflection.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 9aea15c882..d080b81467 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; } -- 2.40.0