Skip to content

Commit

Permalink
better handling when IL header selected
Browse files Browse the repository at this point in the history
  • Loading branch information
psifertex committed Aug 29, 2024
1 parent 4e7196a commit ce6d1d2
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,18 @@ def setupGlobals(uiactioncontext, uicontext):
il_start = view.getSelectionStartILInstructionIndex()

snippetGlobals['current_il_function'] = active_il_function
snippetGlobals['current_il_instruction'] = active_il_function[active_il_index]
snippetGlobals["current_il_basic_block"] = active_il_function[active_il_index].il_basic_block
snippetGlobals['current_il_instructions'] = (active_il_function[i] for i in range(
min(il_start, active_il_index),
max(il_start, active_il_index) + 1)
)
if active_il_index == 0xffffffffffffffff:
# Invalid index
snippetGlobals['current_il_instruction'] = None
snippetGlobals["current_il_basic_block"] = None
snippetGlobals['current_il_instructions'] = None
else:
snippetGlobals['current_il_instruction'] = active_il_function[active_il_index]
snippetGlobals["current_il_basic_block"] = active_il_function[active_il_index].il_basic_block
snippetGlobals['current_il_instructions'] = (active_il_function[i] for i in range(
min(il_start, active_il_index),
max(il_start, active_il_index) + 1)
)
else:
snippetGlobals['current_il_function'] = None
snippetGlobals['current_il_instruction'] = None
Expand Down

0 comments on commit ce6d1d2

Please sign in to comment.