diff --git a/CHANGELOG.md b/CHANGELOG.md index fafb79ea..c6ec65b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.31.3] - 2024-12-21 + +### Fixed + +- Fix a crash produced by not handling new `AccessType`s introduced by `rabbitizer`. +- `rabbitizer` 1.12.5 or above is required. + ## [1.31.2] - 2024-12-02 ### Fixed @@ -1713,6 +1720,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Version 1.0.0 [unreleased]: https://github.com/Decompollaborate/spimdisasm/compare/master...develop +[1.31.3]: https://github.com/Decompollaborate/spimdisasm/compare/1.31.2...1.31.3 [1.31.2]: https://github.com/Decompollaborate/spimdisasm/compare/1.31.1...1.31.2 [1.31.1]: https://github.com/Decompollaborate/spimdisasm/compare/1.31.0...1.31.1 [1.31.0]: https://github.com/Decompollaborate/spimdisasm/compare/1.30.2...1.31.0 diff --git a/README.md b/README.md index 7aab1005..329d2a06 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ If you use a `requirements.txt` file in your repository, then you can add this library with the following line: ```txt -spimdisasm>=1.31.2,<2.0.0 +spimdisasm>=1.31.3,<2.0.0 ``` ### Development version diff --git a/pyproject.toml b/pyproject.toml index 34076f8e..d2a274ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ [project] name = "spimdisasm" # Version should be synced with spimdisasm/__init__.py -version = "1.31.2" +version = "1.31.3" description = "MIPS disassembler" readme = "README.md" license = {file = "LICENSE"} diff --git a/requirements.txt b/requirements.txt index 60c328e1..2e2d92b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -rabbitizer>=1.12.0,<2.0.0 +rabbitizer>=1.12.5,<2.0.0 diff --git a/spimdisasm/__init__.py b/spimdisasm/__init__.py index 8a4a126a..251e5461 100644 --- a/spimdisasm/__init__.py +++ b/spimdisasm/__init__.py @@ -5,7 +5,7 @@ from __future__ import annotations -__version_info__: tuple[int, int, int] = (1, 31, 2) +__version_info__: tuple[int, int, int] = (1, 31, 3) __version__ = ".".join(map(str, __version_info__))# + "-dev0" __author__ = "Decompollaborate" diff --git a/spimdisasm/common/ContextSymbols.py b/spimdisasm/common/ContextSymbols.py index cfd811d2..1786ad6b 100644 --- a/spimdisasm/common/ContextSymbols.py +++ b/spimdisasm/common/ContextSymbols.py @@ -61,7 +61,7 @@ def fromStr(symTypeStr: str|None) -> SymbolSpecialType|None: @dataclasses.dataclass class AccessTypeInfo: - size: int + size: int|None typeSigned: str|None typeUnsigned: str|None typeNameAliases: set[str] = dataclasses.field(default_factory=set) @@ -92,8 +92,13 @@ def getAllTypes(self) -> set[str]: # Ignore signed WORD since it tends to not give a proper type rabbitizer.AccessType.WORD: AccessTypeInfo(4, None, "u32", {"s32", "vs32", "vu32"}), rabbitizer.AccessType.DOUBLEWORD: AccessTypeInfo(8, "s64", "u64", {"vs64", "vu64"}), + rabbitizer.AccessType.QUADWORD: AccessTypeInfo(16, None, None), rabbitizer.AccessType.FLOAT: AccessTypeInfo(4, "f32", None, {"Vec3f"}), rabbitizer.AccessType.DOUBLEFLOAT: AccessTypeInfo(8, "f64", None), + rabbitizer.AccessType.WORD_LEFT: AccessTypeInfo(None, None, None), + rabbitizer.AccessType.WORD_RIGHT: AccessTypeInfo(None, None, None), + rabbitizer.AccessType.DOUBLEWORD_LEFT: AccessTypeInfo(None, None, None), + rabbitizer.AccessType.DOUBLEWORD_RIGHT: AccessTypeInfo(None, None, None), } @@ -590,11 +595,16 @@ def getSize(self) -> int: if currentType is not None and not isinstance(currentType, SymbolSpecialType): for info in gAccessKinds.values(): if info.typeMatchesAccess(currentType): - return info.size + size = info.size + if size is not None: + return size + break # Infer size based on instruction access type if self.accessType is not None: - return gAccessKinds[self.accessType].size + size = gAccessKinds[self.accessType].size + if size is not None: + return size # Infer size based on symbol's address alignment if self.vram % 4 == 0: