Skip to content

Commit eda873f

Browse files
committed
Use memmove as we are pointing to the same memory
I think
1 parent 2aac977 commit eda873f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
File renamed without changes.

Zend/zend_inheritance.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,7 +1918,8 @@ static void zend_resolve_trait_relative_class_types(zend_type *type, /* const */
19181918
}
19191919
if (ZEND_TYPE_IS_RELATIVE_SELF(*single_type)) {
19201920
zend_type resolved_type = (zend_type) ZEND_TYPE_INIT_CLASS(zend_string_copy(ce->name), /* allows_null */ false, /* extra_flags */ ZEND_TYPE_FULL_MASK(*single_type));
1921-
memcpy(single_type, &resolved_type, sizeof(zend_type));
1921+
/* Cannot use memcpy as we violate the restrict constraint of src and dest */
1922+
memmove(single_type, &resolved_type, sizeof(zend_type));
19221923
}
19231924
if (ZEND_TYPE_IS_RELATIVE_PARENT(*single_type)) {
19241925
if (!ce->parent) {
@@ -1927,7 +1928,8 @@ static void zend_resolve_trait_relative_class_types(zend_type *type, /* const */
19271928
return;
19281929
}
19291930
zend_type resolved_type = (zend_type) ZEND_TYPE_INIT_CLASS(zend_string_copy(ce->parent->name), /* allows_null */ false, /* extra_flags */ ZEND_TYPE_FULL_MASK(*single_type));
1930-
memcpy(single_type, &resolved_type, sizeof(zend_type));
1931+
/* Cannot use memcpy as we violate the restrict constraint of src and dest */
1932+
memmove(single_type, &resolved_type, sizeof(zend_type));
19311933
}
19321934
} ZEND_TYPE_FOREACH_END();
19331935
}

0 commit comments

Comments
 (0)