Commit 3d1bc50
committed
Fix ReflectionMethod::invoke() crash with internal closures
The closure identity check added in GH-21366 accessed op_array.opcodes
unconditionally, but internal closures (e.g. var_dump(...)) use
internal_function, not op_array. This caused undefined behavior when
comparing closures created via first-class callable syntax on internal
functions.
Check the function type first: compare op_array.opcodes for user
closures, compare the function pointer directly for internal closures.1 parent c56e8ca commit 3d1bc50
2 files changed
+31
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3447 | 3447 | | |
3448 | 3448 | | |
3449 | 3449 | | |
3450 | | - | |
| 3450 | + | |
| 3451 | + | |
3451 | 3452 | | |
3452 | 3453 | | |
3453 | 3454 | | |
3454 | 3455 | | |
3455 | | - | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
| 3460 | + | |
| 3461 | + | |
| 3462 | + | |
3456 | 3463 | | |
3457 | 3464 | | |
3458 | 3465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
46 | 65 | | |
47 | 66 | | |
48 | 67 | | |
| |||
51 | 70 | | |
52 | 71 | | |
53 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
0 commit comments