summaryrefslogtreecommitdiff
path: root/Zend/zend_language_scanner.l
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-03-07 01:34:03 +0400
committerDmitry Stogov <dmitry@zend.com>2014-03-07 01:34:03 +0400
commit85a5712955b5637b1d33d8c19e27133970e3e2b4 (patch)
treea50bdb287dcb38c3a27469f3eaa6ba7bac3c4c60 /Zend/zend_language_scanner.l
parent6b303a6bd6fe336ee96d99f3e8912fe86aa7cf1a (diff)
downloadphp-git-85a5712955b5637b1d33d8c19e27133970e3e2b4.tar.gz
Fixed __FILE__ and __METHOD__ constants
Diffstat (limited to 'Zend/zend_language_scanner.l')
-rw-r--r--Zend/zend_language_scanner.l9
1 files changed, 5 insertions, 4 deletions
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 8855c0e06a..98c7552b73 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -1613,12 +1613,13 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_IN_SCRIPTING>"__METHOD__" {
if (CG(active_class_entry)) {
- int len = 2;
+ int len = 0;
if (CG(active_class_entry)->name) {
len += CG(active_class_entry)->name->len;
}
if (CG(active_op_array) && CG(active_op_array)->function_name) {
+ len += sizeof("::")-1;
len += CG(active_op_array)->function_name->len;
}
ZVAL_STR(zendlval, STR_ALLOC(len, 0));
@@ -1627,9 +1628,9 @@ NEWLINE ("\r"|"\n"|"\r\n")
memcpy(Z_STRVAL_P(zendlval), CG(active_class_entry)->name->val, CG(active_class_entry)->name->len);
len += CG(active_class_entry)->name->len;
}
- memcpy(Z_STRVAL_P(zendlval) + len, "::", sizeof("::")-1);
- len += sizeof("::")-1;
if (CG(active_op_array) && CG(active_op_array)->function_name) {
+ memcpy(Z_STRVAL_P(zendlval) + len, "::", sizeof("::")-1);
+ len += sizeof("::")-1;
memcpy(Z_STRVAL_P(zendlval) + len, CG(active_op_array)->function_name->val, CG(active_op_array)->function_name->len);
len += CG(active_op_array)->function_name->len;
}
@@ -1653,7 +1654,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
if (!filename) {
filename = STR_EMPTY_ALLOC();
}
- ZVAL_STR(zendlval, filename);
+ ZVAL_STR(zendlval, STR_COPY(filename));
return T_FILE;
}