Skip to content

Fix isinstance check for internal calls in modifier#3016

Open
Iam0TI wants to merge 2 commits into
crytic:masterfrom
Iam0TI:master
Open

Fix isinstance check for internal calls in modifier#3016
Iam0TI wants to merge 2 commits into
crytic:masterfrom
Iam0TI:master

Conversation

@Iam0TI

@Iam0TI Iam0TI commented May 1, 2026

Copy link
Copy Markdown

Summary

Fix a crash in the not-pausable printer caused by incorrect usage of isinstance.

Issue

The current implementation uses:

isinstance(ir, function, SolidityFunction)

How to reproduce

$ slither . --print not-pausable

Output

  File "/opt/homebrew/bin/slither", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.11.5_4/libexec/lib/python3.14/site-packages/slither/__main__.py", line 760, in main
    main_impl(all_detector_classes=detectors, all_printer_classes=printers)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.11.5_4/libexec/lib/python3.14/site-packages/slither/__main__.py", line 865, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
        ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.11.5_4/libexec/lib/python3.14/site-packages/slither/__main__.py", line 106, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
        ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.11.5_4/libexec/lib/python3.14/site-packages/slither/__main__.py", line 86, in process_single
    return _process(slither, detector_classes, printer_classes)
  File "/opt/homebrew/Cellar/slither-analyzer/0.11.5_4/libexec/lib/python3.14/site-packages/slither/__main__.py", line 142, in _process
    printer_results = slither.run_printers()
  File "/opt/homebrew/Cellar/slither-analyzer/0.11.5_4/libexec/lib/python3.14/site-packages/slither/slither.py", line 297, in run_printers
    return [p.output(self._crytic_compile.target).data for p in self._printers]
            ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.11.5_4/libexec/lib/python3.14/site-packages/slither/printers/summary/when_not_paused.py", line 46, in output
    status = "X" if _use_modifier(function, modifier_name) else ""
                    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/slither-analyzer/0.11.5_4/libexec/lib/python3.14/site-packages/slither/printers/summary/when_not_paused.py", line 14, in _use_modifier
    if isinstance(ir, Function, SolidityFunction):
       ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: isinstance expected 2 arguments, got 3

main issue

  File "/opt/homebrew/Cellar/slither-analyzer/0.11.5_4/libexec/lib/python3.14/site-packages/slither/printers/summary/when_not_paused.py", line 14, in _use_modifier
    if isinstance(ir, Function, SolidityFunction):
       ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: isinstance expected 2 arguments, got 3

This is invalid because:

  • isinstance expects 2 arguments, not 3
  • function is a variable, not a type

Fix

Replace with:

isinstance(ir, (Function, SolidityFunction))

@Iam0TI Iam0TI requested a review from smonicas as a code owner May 1, 2026 15:20
@CLAassistant

CLAassistant commented May 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants