Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Zend/Optimizer/zend_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static void zend_dump_unused_op(const zend_op *opline, znode_op op, uint32_t fla
ZEND_API void zend_dump_var(const zend_op_array *op_array, uint8_t var_type, uint32_t var_num)
{
if (var_type == IS_CV && var_num < op_array->last_var) {
fprintf(stderr, "CV%d($%s)", var_num, op_array->vars[var_num]->val);
fprintf(stderr, "CV%d($%s)", var_num, ZSTR_VAL(op_array->vars[var_num]));
} else if (var_type == IS_VAR) {
fprintf(stderr, "V%d", var_num);
} else if ((var_type & (IS_VAR|IS_TMP_VAR)) == IS_TMP_VAR) {
Expand Down Expand Up @@ -223,9 +223,9 @@ static void zend_dump_type_info(uint32_t info, const zend_class_entry *ce, bool
fprintf(stderr, "class");
if (ce) {
if (is_instanceof) {
fprintf(stderr, " (instanceof %s)", ce->name->val);
fprintf(stderr, " (instanceof %s)", ZSTR_VAL(ce->name));
} else {
fprintf(stderr, " (%s)", ce->name->val);
fprintf(stderr, " (%s)", ZSTR_VAL(ce->name));
}
}
} else if ((info & MAY_BE_ANY) == MAY_BE_ANY) {
Expand Down Expand Up @@ -358,9 +358,9 @@ static void zend_dump_type_info(uint32_t info, const zend_class_entry *ce, bool
fprintf(stderr, "object");
if (ce) {
if (is_instanceof) {
fprintf(stderr, " (instanceof %s)", ce->name->val);
fprintf(stderr, " (instanceof %s)", ZSTR_VAL(ce->name));
} else {
fprintf(stderr, " (%s)", ce->name->val);
fprintf(stderr, " (%s)", ZSTR_VAL(ce->name));
}
}
}
Expand Down Expand Up @@ -931,9 +931,9 @@ void zend_dump_op_array_name(const zend_op_array *op_array)
{
if (op_array->function_name) {
if (op_array->scope && op_array->scope->name) {
fprintf(stderr, "%s::%s", op_array->scope->name->val, op_array->function_name->val);
fprintf(stderr, "%s::%s", ZSTR_VAL(op_array->scope->name), ZSTR_VAL(op_array->function_name));
} else {
fprintf(stderr, "%s", op_array->function_name->val);
fprintf(stderr, "%s", ZSTR_VAL(op_array->function_name));
}
} else {
fprintf(stderr, "%s", "$_main");
Expand Down Expand Up @@ -1017,7 +1017,7 @@ ZEND_API void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_fl
if (msg) {
fprintf(stderr, " ; (%s)\n", msg);
}
fprintf(stderr, " ; %s:%u-%u\n", op_array->filename->val, op_array->line_start, op_array->line_end);
fprintf(stderr, " ; %s:%u-%u\n", ZSTR_VAL(op_array->filename), op_array->line_start, op_array->line_end);

if (func_info) {
fprintf(stderr, " ; return ");
Expand Down
10 changes: 5 additions & 5 deletions Zend/zend_operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -3449,8 +3449,8 @@ ZEND_API bool ZEND_FASTCALL zendi_smart_streq(const zend_string *s1, const zend_
zend_long lval1 = 0, lval2 = 0;
double dval1 = 0.0, dval2 = 0.0;

if ((ret1 = is_numeric_string_ex(s1->val, s1->len, &lval1, &dval1, false, &oflow1, NULL)) &&
(ret2 = is_numeric_string_ex(s2->val, s2->len, &lval2, &dval2, false, &oflow2, NULL))) {
if ((ret1 = is_numeric_string_ex(ZSTR_VAL(s1), ZSTR_LEN(s1), &lval1, &dval1, false, &oflow1, NULL)) &&
(ret2 = is_numeric_string_ex(ZSTR_VAL(s2), ZSTR_LEN(s2), &lval2, &dval2, false, &oflow2, NULL))) {
#if ZEND_ULONG_MAX == 0xFFFFFFFF
if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0. &&
((oflow1 == 1 && dval1 > 9007199254740991. /*0x1FFFFFFFFFFFFF*/)
Expand Down Expand Up @@ -3497,8 +3497,8 @@ ZEND_API int ZEND_FASTCALL zendi_smart_strcmp(const zend_string *s1, const zend_
zend_long lval1 = 0, lval2 = 0;
double dval1 = 0.0, dval2 = 0.0;

if ((ret1 = is_numeric_string_ex(s1->val, s1->len, &lval1, &dval1, false, &oflow1, NULL)) &&
(ret2 = is_numeric_string_ex(s2->val, s2->len, &lval2, &dval2, false, &oflow2, NULL))) {
if ((ret1 = is_numeric_string_ex(ZSTR_VAL(s1), ZSTR_LEN(s1), &lval1, &dval1, false, &oflow1, NULL)) &&
(ret2 = is_numeric_string_ex(ZSTR_VAL(s2), ZSTR_LEN(s2), &lval2, &dval2, false, &oflow2, NULL))) {
#if ZEND_ULONG_MAX == 0xFFFFFFFF
if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0. &&
((oflow1 == 1 && dval1 > 9007199254740991. /*0x1FFFFFFFFFFFFF*/)
Expand Down Expand Up @@ -3535,7 +3535,7 @@ ZEND_API int ZEND_FASTCALL zendi_smart_strcmp(const zend_string *s1, const zend_
} else {
int strcmp_ret;
string_cmp:
strcmp_ret = zend_binary_strcmp(s1->val, s1->len, s2->val, s2->len);
strcmp_ret = zend_binary_strcmp(ZSTR_VAL(s1), ZSTR_LEN(s1), ZSTR_VAL(s2), ZSTR_LEN(s2));
return ZEND_NORMALIZE_BOOL(strcmp_ret);
}
}
Expand Down
4 changes: 2 additions & 2 deletions ext/random/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ PHPAPI zend_string *php_random_bin2hex_le(const void *ptr, const size_t len)
/* stolen from standard/string.c */
PHPAPI bool php_random_hex2bin_le(zend_string *hexstr, void *dest)
{
size_t len = hexstr->len >> 1;
unsigned char *str = (unsigned char *) hexstr->val, c, l, d;
size_t len = ZSTR_LEN(hexstr) >> 1;
unsigned char *str = (unsigned char *) ZSTR_VAL(hexstr), c, l, d;
unsigned char *ptr = (unsigned char *) dest;
int is_letter, i = 0;

Expand Down
4 changes: 2 additions & 2 deletions ext/standard/mail.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ PHPAPI zend_string *php_mail_build_headers(const HashTable *headers)
} ZEND_HASH_FOREACH_END();

/* Remove the last \r\n */
if (s.s) s.s->len -= 2;
if (s.s) ZSTR_LEN(s.s) -= 2;
smart_str_0(&s);

return s.s;
Expand Down Expand Up @@ -471,7 +471,7 @@ PHPAPI bool php_mail(const char *to, const char *subject, const char *message, c

time(&curtime);
date_str = php_format_date("d-M-Y H:i:s e", 13, curtime, 1);
len = spprintf(&tmp, 0, "[%s] %s%s", date_str->val, logline, PHP_EOL);
len = spprintf(&tmp, 0, "[%s] %s%s", ZSTR_VAL(date_str), logline, PHP_EOL);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
len = spprintf(&tmp, 0, "[%s] %s%s", ZSTR_VAL(date_str), logline, PHP_EOL);
len = spprintf(&tmp, 0, "[%pS] %s%s", date_str, logline, PHP_EOL);


php_mail_log_to_file(mail_log, tmp, len);

Expand Down
4 changes: 2 additions & 2 deletions ext/zend_test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2331,7 +2331,7 @@ static ZEND_METHOD(_ZendTestClass, takesUnionType)
);
if (!type_matches) {
zend_string *ty = zend_type_to_string(execute_data->func->internal_function.arg_info->type);
zend_argument_type_error(1, "must be of type %s, %s given", ty->val, obj->ce->name->val);
zend_argument_type_error(1, "must be of type %s, %s given", ZSTR_VAL(ty), ZSTR_VAL(obj->ce->name));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zend_argument_type_error(1, "must be of type %s, %s given", ZSTR_VAL(ty), ZSTR_VAL(obj->ce->name));
zend_argument_type_error(1, "must be of type %pS, %pS given", ty, obj->ce->name);

zend_string_release(ty);
RETURN_THROWS();
}
Expand Down Expand Up @@ -2392,7 +2392,7 @@ static ZEND_NAMED_FUNCTION(zend_test_internal_dnf_arguments)
);
if (!type_matches) {
zend_string *ty = zend_type_to_string(arginfo_zend_test_internal_dnf_arguments[1].type);
zend_argument_type_error(1, "must be of type %s, %s given", ty->val, obj->ce->name->val);
zend_argument_type_error(1, "must be of type %s, %s given", ZSTR_VAL(ty), ZSTR_VAL(obj->ce->name));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zend_argument_type_error(1, "must be of type %s, %s given", ZSTR_VAL(ty), ZSTR_VAL(obj->ce->name));
zend_argument_type_error(1, "must be of type %pS, %pS given", ty, obj->ce->name);

zend_string_release(ty);
RETURN_THROWS();
}
Expand Down
Loading