Commit a96b05e
committed
Fix phpGH-19300: Nested array_multisort invocation with error breaks
There are 2 issues:
1. When a MULTISORT_ABORT happens, it frees func, but func may point to
ARRAYG(multisort_func), which would be a problem with nested
invocations as it can destroy that of the "parent" invocation.
To solve this, delay assigning to the globals.
2. The old globals were not restored which means that nested invocations
with different flags will cause a wrong sorting function to be used.
Closes phpGH-19319.1 parent 6fa8a25 commit a96b05e
File tree
4 files changed
+90
-4
lines changed- ext/standard
- tests/array
4 files changed
+90
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5911 | 5911 | | |
5912 | 5912 | | |
5913 | 5913 | | |
5914 | | - | |
| 5914 | + | |
5915 | 5915 | | |
5916 | 5916 | | |
5917 | 5917 | | |
| |||
5927 | 5927 | | |
5928 | 5928 | | |
5929 | 5929 | | |
5930 | | - | |
| 5930 | + | |
5931 | 5931 | | |
5932 | 5932 | | |
5933 | 5933 | | |
| |||
5979 | 5979 | | |
5980 | 5980 | | |
5981 | 5981 | | |
5982 | | - | |
5983 | | - | |
5984 | 5982 | | |
5985 | 5983 | | |
5986 | 5984 | | |
| |||
5998 | 5996 | | |
5999 | 5997 | | |
6000 | 5998 | | |
| 5999 | + | |
| 6000 | + | |
| 6001 | + | |
| 6002 | + | |
| 6003 | + | |
6001 | 6004 | | |
6002 | 6005 | | |
6003 | 6006 | | |
| |||
6074 | 6077 | | |
6075 | 6078 | | |
6076 | 6079 | | |
| 6080 | + | |
6077 | 6081 | | |
6078 | 6082 | | |
6079 | 6083 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments