Skip to content

Commit

Permalink
Fix phpGH-17654: JIT OPcache with CRTO Modes XX14, XX34, XX15 and XX3…
Browse files Browse the repository at this point in the history
…5 Crash The Application

This test has two classes that use the same trait. In function JIT mode
the same cache slot will be used. This causes problems because it is
primed for the first class and then reused for the second class,
resulting in an incorrect type check failure.

The current check for a megamorphic trait call requires current_frame to
not be NULL, but this is only set in tracing mode and not in function
mode.

This patch corrects the check.
  • Loading branch information
nielsdos committed Jan 31, 2025
1 parent f8b57ff commit 6df9e41
Show file tree
Hide file tree
Showing 47 changed files with 79,787 additions and 6 deletions.
22 changes: 22 additions & 0 deletions ext/opcache/jit/ir/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
*.o
*.log
*.dot
*.pdf
ir_fold_hash.h
ir_emit_x86.h
ir_emit_aarch64.h
minilua
gen_ir_fold_hash
ir_test
tester
ir
b.c

tests/**/*.diff
tests/**/*.exp
tests/**/*.ir
tests/**/*.out
tests/**/*.log

win32/vcpkg
win32/build_*
21 changes: 21 additions & 0 deletions ext/opcache/jit/ir/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Zend by Perforce

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions ext/opcache/jit/ir/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This directory contains an embeded version of IR Framework.
See the full version at https://github.com/dstogov/ir
Loading

0 comments on commit 6df9e41

Please # to comment.