Skip to content

Commit

Permalink
Merge pull request #180 from Decompollaborate/develop
Browse files Browse the repository at this point in the history
1.31.3
  • Loading branch information
AngheloAlf authored Dec 21, 2024
2 parents 9415d8e + 0d3a422 commit 85c59af
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rabbitizer>=1.12.0,<2.0.0
rabbitizer>=1.12.5,<2.0.0
2 changes: 1 addition & 1 deletion spimdisasm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
16 changes: 13 additions & 3 deletions spimdisasm/common/ContextSymbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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),
}


Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 85c59af

Please sign in to comment.