Skip to content

Commit 74b10f9

Browse files
Suggestions from TimWolla
1 parent 72dc9df commit 74b10f9

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Zend/zend_attributes.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ static zend_string *validate_allow_dynamic_properties(
8585
msg = "Cannot apply #[\\AllowDynamicProperties] to enum %s";
8686
}
8787
if (msg != NULL) {
88-
smart_str str = {0};
89-
smart_str_append_printf(&str, msg, ZSTR_VAL(scope->name));
90-
return smart_str_extract(&str);
88+
return zend_strpprintf(0, msg, ZSTR_VAL(scope->name));
9189
}
9290
scope->ce_flags |= ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES;
9391
return NULL;
@@ -107,9 +105,7 @@ static zend_string *validate_attribute(
107105
msg = "Cannot apply #[\\Attribute] to abstract class %s";
108106
}
109107
if (msg != NULL) {
110-
smart_str str = {0};
111-
smart_str_append_printf(&str, msg, ZSTR_VAL(scope->name));
112-
return smart_str_extract(&str);
108+
return zend_strpprintf(0, msg, ZSTR_VAL(scope->name));
113109
}
114110
return NULL;
115111
}

Zend/zend_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7604,7 +7604,7 @@ static void zend_compile_attributes(
76047604
if (run_validator && config->validator != NULL) {
76057605
zend_string *error = config->validator(attr, target, CG(active_class_entry));
76067606
if (error != NULL) {
7607-
if (delayed_target_validation == false) {
7607+
if (delayed_target_validation == NULL) {
76087608
zend_error_noreturn(E_COMPILE_ERROR, "%s", ZSTR_VAL(error));
76097609
zend_string_efree(error);
76107610
} else {

0 commit comments

Comments
 (0)