Repository navigation
Commit 5e09eb5
Read PHP 8.6 thread-safe EG() and CG() through the exported offsets
PHP 8.6's thread-safe headers compute the offset of the executor and
compiler globals from sizeof(zend_executor_globals) and
sizeof(zend_compiler_globals), and EG()/CG() compile that constant into
every use. The module API number does not guard those sizes: 8.6.0RC4
appended `delayed_oom` to the executor globals (php-src 3584a98bda0, a
security fix), so an extension built against RC3's headers read and wrote
every EG() field 32 bytes off and crashed on startup.
Redefine EG() and CG() to go through executor_globals_offset and
compiler_globals_offset, which the engine exports, as the headers do up to
8.5. The redefinition comes before the rest of the engine headers, so
their inline functions use it too. Only the version-specific objects
change; the shared core compiles to the same code as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0135ph8YpHvnbDwd4G6rozNY1 parent 528358e commit 5e09eb5
1 file changed
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
32 | 53 | | |
33 | 54 | | |
34 | 55 | | |
| |||
0 commit comments