last_jump has type `int` but is used as type `None`. (#1670)

* last_jump has type `int` but is used as type `None`.

"filename": "mythril/analysis/module/modules/exceptions.py"
"warning_type": "Incompatible variable type [9]"
"warning_message": " last_jump is declared to have type `int` but is used as type `None`."
"warning_line": 28
"fix": None to 0

* Update exceptions.py

* Fix typo

* Add import

Co-authored-by: Nikhil Parasaram <tommycjniko@gmail.com>
Co-authored-by: norhh <nikhilparasaram@gmail.com>
pull/1675/head
Luca Di Grazia 2 years ago committed by GitHub
parent 8590de95d3
commit 8d863fbbf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      mythril/analysis/module/modules/exceptions.py

@ -1,7 +1,7 @@
"""This module contains the detection code for reachable exceptions."""
import logging
from typing import List, cast
from typing import cast, List, Optional
from mythril.analysis import solver
from mythril.analysis.issue_annotation import IssueAnnotation
from mythril.analysis.module.base import DetectionModule, EntryPoint
@ -25,7 +25,7 @@ PANIC_SIGNATURE = [78, 72, 123, 113]
class LastJumpAnnotation(StateAnnotation):
"""State Annotation used if an overflow is both possible and used in the annotated path"""
def __init__(self, last_jump: int = None) -> None:
def __init__(self, last_jump: Optional[int] = None) -> None:
self.last_jump: int = last_jump
def __copy__(self):

Loading…
Cancel
Save