Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ExpressionBuilder from Expression #5641

Merged
merged 1 commit into from
Jul 1, 2024
Merged

Conversation

emesare
Copy link
Member

@emesare emesare commented Jun 20, 2024

This is the rust equivalent to python's LowLevelILFunction.copy_expr. This is very useful when replacing expressions with the original expression being a child expression, as replacing the expression without recreating the original expression will lead to the child expression sharing the same expression index, causing any visitor to infinitely loop.

Unlike the previous PR this is implemented instead on the ExpressionBuilder, this allows greater flexibility and a more explicit API, instead of just implementing Clone and having it be implicitly write back to the IL, having an ExpressionBuilder be created allows you to discard the expression with no side-effects.

@emesare emesare added the Component: Rust API Issue needs changes to the Rust API label Jun 20, 2024
@emesare emesare self-assigned this Jun 20, 2024
@emesare emesare removed their assignment Jun 20, 2024
@emesare emesare merged commit bd34931 into dev Jul 1, 2024
2 checks passed
@emesare emesare deleted the rust_expr_builder_from_expr branch July 3, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Rust API Issue needs changes to the Rust API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant