Skip to content

Commit

Permalink
PCodeConverter: Handle upper case space names.
Browse files Browse the repository at this point in the history
  • Loading branch information
ltfish committed Aug 28, 2024
1 parent 697a40e commit 1bedd01
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ailment/converter_pcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,9 @@ def _convert_load(self) -> None:
"""
spc = self._current_op.inputs[0].getSpaceFromConst()
out = self._current_op.output
assert spc.name in {"ram", "mem", "register"}
if spc.name == "register":
spc_name = spc.name.lower()
assert spc_name in {"ram", "mem", "register", "const"}
if spc_name == "register":
# load from register
res = self._get_value(self._current_op.inputs[1])
stmt = self._set_value(out, res)
Expand All @@ -442,8 +443,9 @@ def _convert_store(self) -> None:
Convert a p-code store operation
"""
spc = self._current_op.inputs[0].getSpaceFromConst()
assert spc.name in {"ram", "mem", "register"}
if spc.name == "register":
spc_name = spc.name.lower()
assert spc_name in {"ram", "mem", "register"}
if spc_name == "register":
# store to register
out = self._current_op.inputs[2]
res = self._get_value(self._current_op.inputs[1])
Expand Down

0 comments on commit 1bedd01

Please sign in to comment.