Commit 062d186
committed
Change zend_ast_attr from uint16_t to uint32_t
The zend_ast_attr type was defined as uint16_t, limiting it to 16 bits,
but it's used to store ZEND_ACC_* flags which can use bits up to 31:
- ZEND_ACC_OVERRIDE = (1 << 28)
- ZEND_ACC_ENUM = (1 << 28)
- ZEND_ACC_STRICT_TYPES = (1U << 31)
While current code doesn't appear to assign these high-bit flags to
ast->attr fields, the type mismatch creates a potential bug where any
future code attempting to store ZEND_ACC flags with bits 16-31 would
have those bits silently truncated to zero.
This change:
1. Changes zend_ast_attr typedef from uint16_t to uint32_t
2. Adds explicit uint16_t __pad field to all AST structures after the
kind field to maintain the same memory layout (padding was already
present implicitly due to alignment)
The structure sizes remain unchanged: we're making existing implicit
padding explicit and widening the attr field to properly accommodate
all ZEND_ACC_* flag values.1 parent 363dd91 commit 062d186
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
| 199 | + | |
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
| |||
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| 209 | + | |
207 | 210 | | |
208 | 211 | | |
209 | 212 | | |
| |||
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
| 218 | + | |
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
| |||
220 | 224 | | |
221 | 225 | | |
222 | 226 | | |
| 227 | + | |
223 | 228 | | |
224 | 229 | | |
225 | 230 | | |
| |||
231 | 236 | | |
232 | 237 | | |
233 | 238 | | |
| 239 | + | |
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
| |||
0 commit comments