# Buggy code
def _post_index_access(self, expression):
    left = get(expression.expression_left)
    right = get(expression.expression_right)
    val = ReferenceVariable(self._node)
    operation = Index(val, left, right, expression.type)
    self._result.append(operation)
    set_val(expression, val)


# Traceback (AssertionError)
ERROR:root:Traceback (most recent call last):
File "c:\users\vyper\documents\github\slither\slither\__main__.py", line 250, in main_impl
(results, number_contracts) = process(filename, args, detector_classes, printer_classes)
File "c:\users\vyper\documents\github\slither\slither\__main__.py", line 35, in process
slither = Slither(filename, args.solc, args.disable_solc_warnings, args.solc_args, ast)
File "c:\users\vyper\documents\github\slither\slither\slither.py", line 41, in __init__
self._analyze_contracts()
File "c:\users\vyper\documents\github\slither\slither\solc_parsing\slitherSolc.py", line 214, in _analyze_contracts
self._convert_to_slithir()
File "c:\users\vyper\documents\github\slither\slither\solc_parsing\slitherSolc.py", line 341, in _convert_to_slithir
contract.convert_expression_to_slithir()
File "c:\users\vyper\documents\github\slither\slither\solc_parsing\declarations\contract.py", line 367, in convert_expression_to_slithir
func.generate_slithir_and_analyze()
File "c:\users\vyper\documents\github\slither\slither\solc_parsing\declarations\function.py", line 927, in generate_slithir_and_analyze
node.slithir_generation()
File "c:\users\vyper\documents\github\slither\slither\core\cfg\node.py", line 506, in slithir_generation
self._irs = convert_expression(expression, self)
File "c:\users\vyper\documents\github\slither\slither\slithir\convert.py", line 734, in convert_expression
visitor = ExpressionToSlithIR(expression, node)
File "c:\users\vyper\documents\github\slither\slither\visitors\slithir\expression_to_slithir.py", line 70, in __init__
self._visit_expression(self.expression)
File "c:\users\vyper\documents\github\slither\slither\visitors\expression\expression.py", line 92, in _visit_expression
self._post_visit(expression)
File "c:\users\vyper\documents\github\slither\slither\visitors\expression\expression.py", line 275, in _post_visit
self._post_index_access(expression)
File "c:\users\vyper\documents\github\slither\slither\visitors\slithir\expression_to_slithir.py", line 163, in _post_index_access
operation = Index(val, left, right, expression.type)
File "c:\users\vyper\documents\github\slither\slither\slithir\operations\index.py", line 13, in __init__
assert is_valid_lvalue(left_variable) or left_variable == SolidityVariableComposed('msg.data')
AssertionError

# Fixed code
def _post_index_access(self, expression):
    left = get(expression.expression_left)
    right = get(expression.expression_right)
    val = ReferenceVariable(self._node)
    # access to anonymous array
    # such as [0,1][x]
    if isinstance(left, list):
        init_array_val = TemporaryVariable(self._node)
        init_array_right = left
        left = init_array_val
        operation = InitArray(init_array_right, init_array_val)
        self._result.append(operation)
    operation = Index(val, left, right, expression.type)
    self._result.append(operation)
    set_val(expression, val)