Commit 59db671
Fix
* Fix `Any` hasbit consistency issue in OSS.
`Any` `value` field is a `bytes` field in OSS, and since cl/792909628 (#22956), `_internal_mutable_*()` accessors for string fields don't set hasbits. This can cause the hasbit to be missing for the `value` field of `Any` after calling `PackFrom`, which will serialize incorrectly.
This change also includes fixes to `any_test`, which failed to catch this bug. We got unlucky, and every test which checked a roundtrip `PackFrom` -> `UnpackTo` for an `Any` field reused the same `Any` object, calling `MessageLite::ParseFromString` (which `Clear()`s it) on the same object. However, `Clear()` skips string fields whose hasbits are not set. This meant the `string value` field of the `Any` was not cleared, since its hasbit had not been properly set by `PackFrom`. So even though the `Any` value skipped serializing its value, the reused `Any` object still contained the expected `string value` serialization of the submessage, and `UnpackTo` worked correctly.
The culprit change was adopted in release 33.0, so it will need to be patched to this version.
See #24258.
Fixes #24258
PiperOrigin-RevId: 828299368
* update staleness
* Upgrade setup-php to speed up PHP tests
This build has become a severe bottleneck in our CI. To avoid this in the future, always use whatever pre-install version is on the mac runners. The linux tests will cover specific versions of PHP still.
PiperOrigin-RevId: 818864695
---------
Co-authored-by: Clayton Knittel <cknittel@google.com>
Co-authored-by: Mike Kruskal <mkruskal@google.com>Any hasbit consistency issue in OSS. (#24400)1 parent 39d437f commit 59db671
File tree
4 files changed
+68
-67
lines changed- .github/workflows
- src/google/protobuf
- compiler/cpp
4 files changed
+68
-67
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | 204 | | |
209 | 205 | | |
210 | 206 | | |
211 | 207 | | |
212 | 208 | | |
213 | 209 | | |
214 | | - | |
| 210 | + | |
215 | 211 | | |
216 | 212 | | |
217 | 213 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | 214 | | |
223 | 215 | | |
224 | 216 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | | - | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
74 | 81 | | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | | - | |
78 | | - | |
| 85 | + | |
79 | 86 | | |
| 87 | + | |
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
83 | 91 | | |
84 | 92 | | |
85 | | - | |
86 | | - | |
87 | 93 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
97 | 107 | | |
98 | 108 | | |
99 | | - | |
| 109 | + | |
100 | 110 | | |
101 | 111 | | |
102 | 112 | | |
| |||
127 | 137 | | |
128 | 138 | | |
129 | 139 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | 140 | | |
134 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
135 | 146 | | |
136 | 147 | | |
137 | 148 | | |
138 | 149 | | |
139 | 150 | | |
140 | | - | |
| 151 | + | |
141 | 152 | | |
142 | 153 | | |
143 | 154 | | |
144 | 155 | | |
145 | 156 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | 157 | | |
150 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
151 | 163 | | |
152 | 164 | | |
153 | 165 | | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
157 | | - | |
| 169 | + | |
158 | 170 | | |
159 | 171 | | |
160 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1770 | 1770 | | |
1771 | 1771 | | |
1772 | 1772 | | |
1773 | | - | |
1774 | | - | |
| 1773 | + | |
1775 | 1774 | | |
1776 | 1775 | | |
1777 | 1776 | | |
1778 | 1777 | | |
1779 | 1778 | | |
1780 | 1779 | | |
1781 | | - | |
| 1780 | + | |
1782 | 1781 | | |
1783 | 1782 | | |
1784 | 1783 | | |
| |||
1796 | 1795 | | |
1797 | 1796 | | |
1798 | 1797 | | |
1799 | | - | |
| 1798 | + | |
1800 | 1799 | | |
1801 | 1800 | | |
1802 | 1801 | | |
1803 | 1802 | | |
1804 | 1803 | | |
1805 | 1804 | | |
1806 | 1805 | | |
1807 | | - | |
1808 | | - | |
1809 | | - | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
1810 | 1809 | | |
1811 | 1810 | | |
1812 | 1811 | | |
| |||
1822 | 1821 | | |
1823 | 1822 | | |
1824 | 1823 | | |
1825 | | - | |
1826 | | - | |
| 1824 | + | |
1827 | 1825 | | |
1828 | 1826 | | |
1829 | 1827 | | |
1830 | 1828 | | |
1831 | 1829 | | |
1832 | 1830 | | |
1833 | | - | |
| 1831 | + | |
1834 | 1832 | | |
1835 | 1833 | | |
1836 | 1834 | | |
| |||
0 commit comments