Skip to content

Commit

Permalink
fix migration not properly stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Sep 10, 2024
1 parent 0e68a0a commit 74ab2b2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spimdisasm/mips/FuncRodataEntry.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def _updateMigrableSymbolsSets(rodataSym: symbols.SymbolBase, intersection: set[
rodataMigratedSomewhereElse = True
elif rodataSym.shouldMigrate():
maybeMigrableRodataSyms.add(rodataSym.vram)
else:
rodataMigratedSomewhereElse = True

return rodataMigratedSomewhereElse

Expand Down
5 changes: 5 additions & 0 deletions spimdisasm/mips/symbols/MipsSymbolBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ def isJumpTable(self) -> bool:
return False


#! @deprecated
def isRdata(self) -> bool:
"Checks if the current symbol is .rdata"
return False

def shouldMigrate(self) -> bool:
return False

Expand Down
13 changes: 13 additions & 0 deletions spimdisasm/mips/symbols/MipsSymbolRodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ def isMaybeConstVariable(self) -> bool:
return False
return True

#! @deprecated
def isRdata(self) -> bool:
"Checks if the current symbol is .rdata"
if self.isMaybeConstVariable():
return True

# This symbol could be an unreferenced non-const variable
if len(self.contextSym.referenceFunctions) == 1:
# This const variable was already used in a function
return False

return True

def shouldMigrate(self) -> bool:
if self.contextSym.functionOwnerForMigration is not None:
return True
Expand Down

0 comments on commit 74ab2b2

Please sign in to comment.