summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_API.h6
-rw-r--r--Zend/zend_builtin_functions.c12
-rw-r--r--Zend/zend_vm_def.h2
3 files changed, 11 insertions, 9 deletions
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 39ea3016f2..41ef47e4ff 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -610,8 +610,9 @@ END_EXTERN_C()
#define RETVAL_LONG(l) ZVAL_LONG(return_value, l)
#define RETVAL_DOUBLE(d) ZVAL_DOUBLE(return_value, d)
#define RETVAL_STR(s) ZVAL_STR(return_value, s)
-#define RETVAL_LONG_STR(s) ZVAL_INTERNED_STR(return_value, s)
+#define RETVAL_INTERNED_STR(s) ZVAL_INTERNED_STR(return_value, s)
#define RETVAL_NEW_STR(s) ZVAL_NEW_STR(return_value, s)
+#define RETVAL_STR_COPY(s) ZVAL_STR_COPY(return_value, s)
#define RETVAL_STRING(s) ZVAL_STRING(return_value, s)
#define RETVAL_STRINGL(s, l) ZVAL_STRINGL(return_value, s, l)
#define RETVAL_EMPTY_STRING() ZVAL_EMPTY_STRING(return_value)
@@ -626,8 +627,9 @@ END_EXTERN_C()
#define RETURN_LONG(l) { RETVAL_LONG(l); return; }
#define RETURN_DOUBLE(d) { RETVAL_DOUBLE(d); return; }
#define RETURN_STR(s) { RETVAL_STR(s); return; }
-#define RETURN_LONG_STR(s) { RETVAL_LONG_STR(s); return; }
+#define RETURN_INTERNED_STR(s) { RETVAL_INTERNED_STR(s); return; }
#define RETURN_NEW_STR(s) { RETVAL_NEW_STR(s); return; }
+#define RETURN_STR_COPY(s) { RETVAL_STR_COPY(s); return; }
#define RETURN_STRING(s) { RETVAL_STRING(s); return; }
#define RETURN_STRINGL(s, l) { RETVAL_STRINGL(s, l); return; }
#define RETURN_EMPTY_STRING() { RETVAL_EMPTY_STRING(); return; }
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 195d9c2509..a620e45a65 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -900,14 +900,14 @@ ZEND_FUNCTION(get_class)
if (!obj) {
if (EG(scope)) {
- RETURN_STR(zend_string_copy(EG(scope)->name));
+ RETURN_STR_COPY(EG(scope)->name);
} else {
zend_error(E_WARNING, "get_class() called without object from outside a class");
RETURN_FALSE;
}
}
- RETURN_STR(zend_string_copy(Z_OBJCE_P(obj)->name));
+ RETURN_STR_COPY(Z_OBJCE_P(obj)->name);
}
/* }}} */
@@ -920,7 +920,7 @@ ZEND_FUNCTION(get_called_class)
}
if (EX(called_scope)) {
- RETURN_STR(zend_string_copy(EX(called_scope)->name));
+ RETURN_STR_COPY(EX(called_scope)->name);
} else if (!EG(scope)) {
zend_error(E_WARNING, "get_called_class() called from outside a class");
}
@@ -942,7 +942,7 @@ ZEND_FUNCTION(get_parent_class)
if (!ZEND_NUM_ARGS()) {
ce = EG(scope);
if (ce && ce->parent) {
- RETURN_STR(zend_string_copy(ce->parent->name));
+ RETURN_STR_COPY(ce->parent->name);
} else {
RETURN_FALSE;
}
@@ -955,7 +955,7 @@ ZEND_FUNCTION(get_parent_class)
}
if (ce && ce->parent) {
- RETURN_STR(zend_string_copy(ce->parent->name));
+ RETURN_STR_COPY(ce->parent->name);
} else {
RETURN_FALSE;
}
@@ -1950,7 +1950,7 @@ ZEND_FUNCTION(create_function)
do {
function_name->len = snprintf(function_name->val + 1, sizeof("lambda_")+MAX_LENGTH_OF_LONG, "lambda_%d", ++EG(lambda_count)) + 1;
} while (zend_hash_add_ptr(EG(function_table), function_name, func) == NULL);
- RETURN_STR(function_name);
+ RETURN_NEW_STR(function_name);
} else {
zend_hash_str_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME)-1);
RETURN_FALSE;
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 9714cf7ad3..ffb737d2a2 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -4369,7 +4369,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
char *actual = (char *)zend_memrchr(Z_STRVAL_P(EX_CONSTANT(opline->op2)), '\\', Z_STRLEN_P(EX_CONSTANT(opline->op2)));
if (!actual) {
- ZVAL_STR(EX_VAR(opline->result.var), zend_string_copy(Z_STR_P(EX_CONSTANT(opline->op2))));
+ ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_STR_P(EX_CONSTANT(opline->op2)));
} else {
actual++;
ZVAL_STRINGL(EX_VAR(opline->result.var),