php-src/Zend/tests/enum
Ilija Tovilo 93fc88e808
Fix Enum::from/tryFrom memory leak in JIT for internal enums
when passing an int to a string enum. Previously, the int was coerced to
a string. The JIT skips parameter clean up when unnecessary. In this
particular case, passing int to from(int|string) normally doesn't cause
a coercion so no dtor for the $value zval is generated.

To circumvent this we avoid coersion by explicitly allowing ints and
converting them to strings ourselves. Then we can free it appropriately.

See GH-8518
Closes GH-8633
2022-05-28 10:51:17 +02:00
..
__call.phpt
__callStatic.phpt
__class__.phpt
__function__.phpt
__get.phpt
__invoke.phpt
__isset.phpt
__method__.phpt
ast-dumper.phpt
backed-cases-int.phpt
backed-cases-string.phpt
backed-duplicate-int.phpt
backed-duplicate-string.phpt
backed-from-invalid-int.phpt
backed-from-invalid-string.phpt
backed-from-invalid-type.phpt
backed-from-unknown-hash.phpt
backed-from.phpt
backed-implements-multiple.phpt Add test cases for backed enum implementing interface 2021-10-20 09:53:51 +02:00
backed-implements.phpt Add test cases for backed enum implementing interface 2021-10-20 09:53:51 +02:00
backed-int-case-without-value.phpt
backed-int-const-expr.phpt
backed-int-const-invalid-expr.phpt Fixed bug #81465 2021-09-23 14:29:27 +02:00
backed-int.phpt
backed-invalid.phpt
backed-mismatch.phpt
backed-negative-int.phpt
backed-string-heredoc.phpt
backed-string.phpt
backed-tryFrom-casing.phpt
backed-tryFrom-unknown-hash.phpt
backed-tryFrom.phpt
backed-type-no-union.phpt
basic-methods.phpt
case-attributes.phpt
case-in-class.phpt
cases-refcount.phpt
comparison.phpt
constant-aliases.phpt
constants.phpt
default-parameter.phpt
enum_exists.phpt
enum-as-constant.phpt
enum-as-params.phpt
enum-attributes.phpt
enum-in-constant.phpt
enum-in-static-var.phpt
enum-reserved-non-modifiers.phpt
final.phpt Improve class inheritance error messages (#7307) 2021-07-27 09:42:37 +02:00
gh8176.phpt Fix GH-8176: Fix leaking enum values in property initializers 2022-03-07 18:26:46 +01:00
implements.phpt
instanceof-backed-enum.phpt
instanceof-unitenum.phpt
instanceof.phpt
internal_enums_strict_types.phpt Fix Enum::from/tryFrom memory leak in JIT for internal enums 2022-05-28 10:51:17 +02:00
internal_enums.phpt Fix Enum::from/tryFrom memory leak in JIT for internal enums 2022-05-28 10:51:17 +02:00
json_encode.phpt Register JSON_ERROR_NON_BACKED_ENUM constant (#8285) 2022-03-31 14:31:17 +02:00
keyword-no-bc-break.phpt
keyword-whitespace.phpt
name-property.phpt
namespaces.phpt
no-cases.phpt
no-class-implements-backed-enum.phpt
no-class-implements-unit-enum.phpt
no-clone.phpt
no-constructors.phpt
no-destruct.phpt
no-dynamic-properties.phpt Don't use custom object handlers for enum properties 2021-08-13 16:44:39 +02:00
no-enum-implements-backed-enum.phpt
no-enum-implements-unit-enum.phpt
no-from.phpt
no-implement-serializable-indirect.phpt Include class name in Serializable deprecation message 2021-08-11 10:35:47 +02:00
no-implement-serializable.phpt Include class name in Serializable deprecation message 2021-08-11 10:35:47 +02:00
no-name-property.phpt
no-new-through-reflection.phpt
no-new.phpt
no-non-backed-enum-implements-backed-enum.phpt
no-pass-properties-by-ref.phpt Don't use custom object handlers for enum properties 2021-08-13 16:44:39 +02:00
no-properties.phpt
no-return-properties-by-ref.phpt Don't use custom object handlers for enum properties 2021-08-13 16:44:39 +02:00
no-static-properties.phpt
no-unsed-value.phpt
no-unset-propertes.phpt Don't use custom object handlers for enum properties 2021-08-13 16:44:39 +02:00
no-value-property.phpt
no-write-properties-cache-slot.phpt Fix message in test 2021-08-13 17:01:16 +02:00
no-write-properties-through-foreach-reference.phpt Don't use custom object handlers for enum properties 2021-08-13 16:44:39 +02:00
no-write-properties-through-references.phpt Don't use custom object handlers for enum properties 2021-08-13 16:44:39 +02:00
no-write-properties.phpt Fix typo in enum test (#7368) 2021-08-14 09:53:37 +02:00
non-backed-enum-with-expr-value.phpt
non-backed-enum-with-int-value.phpt
non-backed-enum-with-invalid-value.phpt
non-backed-enum-with-string-value.phpt
offsetGet-in-const-expr.phpt Declare tentative return types for Zend (#7251) 2021-07-19 13:44:20 +02:00
print_r.phpt
reflectionclass.phpt
serialization-round-trip.phpt
serialize.phpt
spl-object-storage.phpt
static-methods.phpt
traits-no-__construct.phpt
traits-no-cases-method.phpt
traits-no-forbidden-methods.phpt
traits-no-properties.phpt
traits.phpt
unit-cases.phpt
unserialize-const.phpt
unserialize-missing-colon.phpt
unserialize-non-enum.phpt
unserialize-non-existent-case.phpt
unserialize-refcount.phpt
unserialize.phpt
value-property-type.phpt
var_dump-nested.phpt
var_dump-reference.phpt
var_export.phpt Fix false positive recursion warning for var_export of enums (#7201) 2021-06-26 15:33:39 -04:00
weak-map.phpt Fixed bug #81514 2021-10-08 10:31:24 +02:00