File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -169,12 +169,18 @@ def setupGlobals(uiactioncontext, uicontext):
169
169
il_start = view .getSelectionStartILInstructionIndex ()
170
170
171
171
snippetGlobals ['current_il_function' ] = active_il_function
172
- snippetGlobals ['current_il_instruction' ] = active_il_function [active_il_index ]
173
- snippetGlobals ["current_il_basic_block" ] = active_il_function [active_il_index ].il_basic_block
174
- snippetGlobals ['current_il_instructions' ] = (active_il_function [i ] for i in range (
175
- min (il_start , active_il_index ),
176
- max (il_start , active_il_index ) + 1 )
177
- )
172
+ if active_il_index == 0xffffffffffffffff :
173
+ # Invalid index
174
+ snippetGlobals ['current_il_instruction' ] = None
175
+ snippetGlobals ["current_il_basic_block" ] = None
176
+ snippetGlobals ['current_il_instructions' ] = None
177
+ else :
178
+ snippetGlobals ['current_il_instruction' ] = active_il_function [active_il_index ]
179
+ snippetGlobals ["current_il_basic_block" ] = active_il_function [active_il_index ].il_basic_block
180
+ snippetGlobals ['current_il_instructions' ] = (active_il_function [i ] for i in range (
181
+ min (il_start , active_il_index ),
182
+ max (il_start , active_il_index ) + 1 )
183
+ )
178
184
else :
179
185
snippetGlobals ['current_il_function' ] = None
180
186
snippetGlobals ['current_il_instruction' ] = None
You can’t perform that action at this time.
0 commit comments