Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NodeSolc' object has no attribute 'nodeId' (with weird continue structure) #111

Open
agroce opened this issue Dec 20, 2018 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@agroce
Copy link
Contributor

agroce commented Dec 20, 2018

running slither on this file:

pragma solidity ^0.4.0;
contract c {
function f() public payable returns (int) {
{
do
{
do
continue;
while (false);
continue;
}
while (false);
}
}
}

crashes with this error:

INFO:Slither:Compilation warnings/errors on reduced.sol:
Warning: This is a pre-release compiler version, please do not use it in production.
reduced.sol:1:1: Warning: Source file does not specify required compiler version!
contract c {
^ (Relevant source part starts here and spans across multiple lines).

ERROR:root:Error in reduced.sol
ERROR:root:Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/slither/__main__.py", line 235, in main_impl
    (results, number_contracts) = process(filename, args, detector_classes, printer_classes)
  File "/usr/local/lib/python3.7/site-packages/slither/__main__.py", line 35, in process
    slither = Slither(filename, args.solc, args.disable_solc_warnings, args.solc_args, ast)
  File "/usr/local/lib/python3.7/site-packages/slither/slither.py", line 41, in __init__
    self._analyze_contracts()
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/slitherSolc.py", line 187, in _analyze_contracts
    self._analyze_third_part(contracts_to_be_analyzed, libraries)
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/slitherSolc.py", line 269, in _analyze_third_part
    self._analyze_variables_modifiers_functions(contract)
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/slitherSolc.py", line 309, in _analyze_variables_modifiers_functions
    contract.analyze_content_functions()
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/declarations/contract.py", line 347, in analyze_content_functions
    function.analyze_content()
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/declarations/function.py", line 809, in analyze_content
    self._parse_cfg(child)
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/declarations/function.py", line 610, in _parse_cfg
    self._remove_incorrect_edges()
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/declarations/function.py", line 676, in _remove_incorrect_edges
    self._fix_continue_node(node)
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/declarations/function.py", line 659, in _fix_continue_node
    logger.error('Continue in no-loop context {}'.format(node.nodeId()))
AttributeError: 'NodeSolc' object has no attribute 'nodeId'

The code structure is odd, but the compiler seems to accept it.

@montyly montyly self-assigned this Jan 3, 2019
@montyly montyly added the bug Something isn't working label Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants