binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Create ExpressionBuilder from Expression

Open emesare opened this issue 1 year ago • 0 comments

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 avatar Jun 20 '24 12:06 emesare