Skip to content

Prevent empty nodes#17

Open
meck-gd wants to merge 3 commits intothewhiteninja:masterfrom
GDATAAdvancedAnalytics:prevent-empty-nodes
Open

Prevent empty nodes#17
meck-gd wants to merge 3 commits intothewhiteninja:masterfrom
GDATAAdvancedAnalytics:prevent-empty-nodes

Conversation

@meck-gd
Copy link
Copy Markdown
Contributor

@meck-gd meck-gd commented Sep 22, 2025

This MR changes Get-AST so it doesn't create the sort of empty nodes that would be removed later on in optimization passes anyway. Most of those nodes should be (mostly, already are) attributes instead.

The resulting XMLs are up to 15% smaller, which can make a significant difference for multi-megabyte input scripts with AST node counts in the millions.

I've repurposed the opt_remove_empty_nodes pass to make malware2 look nicer instead - in combination with the new opt_remove_nested_statement_blocks.

@meck-gd meck-gd mentioned this pull request Sep 26, 2025
@meck-gd
Copy link
Copy Markdown
Contributor Author

meck-gd commented Dec 16, 2025

@thewhiteninja Any comments on this? I know the MR diff looks obnoxiously huge, but that's mostly because of the data update. The first two commits should be much more reviewable individually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant