Add dedicated zend_ast_op_array struct (#17391)

Given that the `ZEND_AST_OP_ARRAY` type already needed special handling in
various places, it makes sense to give it its own struct to avoid some of the
casts. As a side benefit, it is a little smaller than the `zend_ast_zval`
struct.
This commit is contained in:
Tim Düsterhus 2025-01-08 11:26:35 +01:00 committed by GitHub
parent fd1eacc2ed
commit cee64ed3bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 58 additions and 21 deletions

View file

@ -190,6 +190,8 @@ class ZendAstPrettyPrinter(gdb.printing.PrettyPrinter):
if kind == enum_value('ZEND_AST_ZVAL') or kind == enum_value('ZEND_AST_CONSTANT'):
return self.val.cast(gdb.lookup_type('zend_ast_zval'))
if kind == enum_value('ZEND_AST_OP_ARRAY'):
return self.val.cast(gdb.lookup_type('zend_ast_op_array'))
if kind == enum_value('ZEND_AST_ZNODE'):
return self.val.cast(gdb.lookup_type('zend_ast_znode'))
if self.is_decl():