# Buggy code
def _process_block(self, state, block):  # pylint:disable=no-self-use
    """
    Scan through all statements and perform the following tasks:
    - Find stack pointers and the VEX temporary variable storing stack pointers
    - Selectively calculate VEX statements
    - Track memory loading and mark stack and global variables accordingly

    :param angr.Block block:
    :return:
    """

    l.debug("Processing block %#x.", block.addr)

    processor = (
        self._ail_engine if isinstance(block, ailment.Block) else self._vex_engine
    )
    processor.process(state, block=block, fail_fast=self._fail_fast)

    # readjusting sp at the end for blocks that end in a call
    if block.addr in self._node_to_cc:
        cc = self._node_to_cc[block.addr]
        state.processor_state.sp_adjustment += cc.sp_delta
        state.processor_state.sp_adjusted = True
        l.debug(
            "Adjusting stack pointer at end of block %#x with offset %+#x.",
            block.addr,
            state.processor_state.sp_adjustment,
        )


# Traceback (TypeError)
Traceback (most recent call last):
File "$HOME/angr-dev/angr-management/angrmanagement/ui/widgets/qfunction_table.py", line 227, in _on_function_selected
self._selection_callback(selected_func)
File "$HOME/angr-dev/angr-management/angrmanagement/ui/views/functions_view.py", line 41, in _on_function_selected
self.workspace.on_function_selected(function)
File "$HOME/angr-dev/angr-management/angrmanagement/ui/workspace.py", line 57, in on_function_selected
self.views_by_category['disassembly'][0].display_function(function)
File "$HOME/angr-dev/angr-management/angrmanagement/ui/views/disassembly_view.py", line 171, in display_function
self._display_function(function)
File "$HOME/angr-dev/angr-management/angrmanagement/ui/views/disassembly_view.py", line 343, in _display_function
vr = self.workspace.instance.project.analyses.VariableRecoveryFast(the_func)
File "$HOME/angr-dev/angr/angr/analyses/analysis.py", line 108, in __call__
oself.__init__(*args, **kwargs)
File "$HOME/angr-dev/angr/angr/analyses/variable_recovery/variable_recovery_fast.py", line 510, in __init__
self._analyze()
File "$HOME/angr-dev/angr/angr/analyses/forward_analysis.py", line 557, in _analyze
self._analysis_core_graph()
File "$HOME/angr-dev/angr/angr/analyses/forward_analysis.py", line 583, in _analysis_core_graph
self._add_input_state(n, output_state)
File "$HOME/angr-dev/angr/angr/analyses/forward_analysis.py", line 605, in _add_input_state
self._state_map[succ] = self._merge_states(succ, *([ self._state_map[succ], input_state ]))
File "$HOME/angr-dev/angr/angr/analyses/variable_recovery/variable_recovery_fast.py", line 551, in _merge_states
return states[0].merge(states[1], successor=node.addr)
File "$HOME/angr-dev/angr/angr/analyses/variable_recovery/variable_recovery_fast.py", line 448, in merge
processor_state=self.processor_state.copy().merge(other.processor_state),
File "$HOME/angr-dev/angr/angr/analyses/variable_recovery/variable_recovery_fast.py", line 53, in merge
self.bp = max(self.bp, other.bp)
TypeError: '>' not supported between instances of 'NoneType' and 'NoneType'

# Fixed code
def _process_block(self, state, block):  # pylint:disable=no-self-use
    """
    Scan through all statements and perform the following tasks:
    - Find stack pointers and the VEX temporary variable storing stack pointers
    - Selectively calculate VEX statements
    - Track memory loading and mark stack and global variables accordingly

    :param angr.Block block:
    :return:
    """

    l.debug("Processing block %#x.", block.addr)

    processor = (
        self._ail_engine if isinstance(block, ailment.Block) else self._vex_engine
    )
    processor.process(state, block=block, fail_fast=self._fail_fast)

    # readjusting sp at the end for blocks that end in a call
    if block.addr in self._node_to_cc:
        cc = self._node_to_cc[block.addr]
        if cc is not None:
            state.processor_state.sp_adjustment += cc.sp_delta
            state.processor_state.sp_adjusted = True
            l.debug(
                "Adjusting stack pointer at end of block %#x with offset %+#x.",
                block.addr,
                state.processor_state.sp_adjustment,
            )