``get_expr`` retrieves the IL expression at a given expression index in the function. .. warning :: Not all IL expressions are valid, even if their index is within the bounds of the function, they might not be used by the function and might not contain properly structured data.
(self, index: ExpressionIndex, as_ast: bool = True)
| 2893 | return core.BNGetHighLevelILExprCount(self.handle) |
| 2894 | |
| 2895 | def get_expr(self, index: ExpressionIndex, as_ast: bool = True) -> Optional[HighLevelILInstruction]: |
| 2896 | """ |
| 2897 | ``get_expr`` retrieves the IL expression at a given expression index in the function. |
| 2898 | |
| 2899 | .. warning :: Not all IL expressions are valid, even if their index is within the bounds of the function, |
| 2900 | they might not be used by the function and might not contain properly structured data. |
| 2901 | |
| 2902 | :param index: Index of desired expression in function |
| 2903 | :param as_ast: Whether to return the expression as a full AST or a single instruction (defaults to AST) |
| 2904 | :return: A HighLevelILInstruction object for the expression, if it exists. Otherwise, None |
| 2905 | """ |
| 2906 | if index >= self.get_expr_count(): |
| 2907 | return None |
| 2908 | |
| 2909 | return HighLevelILInstruction.create(self, index, as_ast) |
| 2910 | |
| 2911 | def copy_expr(self, original: HighLevelILInstruction) -> ExpressionIndex: |
| 2912 | """ |
no test coverage detected