You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following contract will cause slither to throw an error:
contract C {
function f() public {
uint8[1] memory x = [ 77 ];
}
}
It seems creating an array with size 1, with the single element specified by a literal causes slither to fail to generate SSA. If the element is specified as a variable in the array, it will not throw an error. This was also tested with a bool[1] memory x = [ false ]; and threw an error as well.
Stack trace:
ERROR:root:Traceback (most recent call last):
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 386, in convert_expression_to_slithir
func.generate_slithir_ssa(all_ssa_state_variables_instances)
File "c:\users\vyper\documents\github\slither\slither\solc_parsing\declarations\function.py", line 935, in generate_slithir_ssa
add_ssa_ir(self, all_ssa_state_variables_instances)
File "c:\users\vyper\documents\github\slither\slither\slithir\utils\ssa.py", line 123, in add_ssa_ir
[])
File "c:\users\vyper\documents\github\slither\slither\slithir\utils\ssa.py", line 295, in generate_ssa_irs
visited)
File "c:\users\vyper\documents\github\slither\slither\slithir\utils\ssa.py", line 285, in generate_ssa_irs
new_ir.lvalue.add_refers_to(new_ir.rvalue)
File "c:\users\vyper\documents\github\slither\slither\slithir\variables\local_variable.py", line 56, in add_refers_to
self._refers_to.add(variable)
TypeError: unhashable type: 'Constant'
The text was updated successfully, but these errors were encountered:
The following contract will cause slither to throw an error:
It seems creating an array with size 1, with the single element specified by a literal causes slither to fail to generate SSA. If the element is specified as a variable in the array, it will not throw an error. This was also tested with a
bool[1] memory x = [ false ];
and threw an error as well.Stack trace:
The text was updated successfully, but these errors were encountered: