Skip to content

Conversation

elminson
Copy link
Owner

No description provided.

dstogov and others added 30 commits May 6, 2024 09:52
* PHP-8.2:
  Fix undefined behavior (left shift of negative number)
* PHP-8.3:
  Fix undefined behavior (left shift of negative number)
Fixes GH-13970
Closes GH-14105

We cannot validate at compile-time for multiple reasons:

* Evaluating the argument naively with zend_get_attribute_value can lead to code
  execution at compile time through the new expression, leading to possible
  reentrance of the compiler.
* Even if the evaluation was possible, it would need to be restricted to the
  current file, because constant values coming from other files can change
  without affecting the current compilation unit. For this reason, validation
  would need to be repeated at runtime anyway.
* Enums cannot be instantiated at compile-time (the actual bug report). This
  could be allowed here, because the value is immediately destroyed. But given
  the other issues, this won't be needed.

Instead, we just move it to runtime entirely. It's only needed for
ReflectionAttribute::newInstance(), which is not particularly a hot path. The
checks are also simple.
* PHP-8.2:
  Delay #[Attribute] arg validation until runtime
* PHP-8.3:
  Delay #[Attribute] arg validation until runtime
* PHP-8.3:
  Fix attribute test on newer branches
Class constants are inherited to user classes without cloning. Thus, internal
class constants should not be persisted at all. Simply keep pointing to the
internal class constant.

Fixes GH-14109
Closes GH-14114
* PHP-8.2:
  Fix persisting of inherited class constants
* PHP-8.3:
  Fix persisting of inherited class constants
* PHP-8.3:
  Add test for GH-14109
This field is only ever written to, but never read.
There's no point in checking the length, this just wastes time.
* Fix prototype for trait methods

Fixes GH-14009

* Clenup do_inheritance_check_on_method()

Remove wierd checks and define the behavior by explicit set of flags

* Fix naming and indentation

---------

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
* PHP-8.2:
  Fix prototype for trait methods (#14148)
* PHP-8.3:
  Fix prototype for trait methods (#14148)
IR commit: fe4ba285bc576d83bea4a8099fb7315b8bc8c7fb
_bc_do_sub now uses SIMD to perform calculations at high speed.

Moved the macros used for SIMD to `private.h`, and added some constants
and macros.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment