diff --git a/proxyclient/m1n1/asm.py b/proxyclient/m1n1/asm.py index 5b7d1a9b..93fae4c2 100644 --- a/proxyclient/m1n1/asm.py +++ b/proxyclient/m1n1/asm.py @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -import os, tempfile, shutil, subprocess +import os, tempfile, shutil, subprocess, re from . import sysreg __all__ = ["AsmException", "ARMAsm"] @@ -55,7 +55,7 @@ class BaseAsm(object): def compile(self, source): for name, enc in sysreg.sysreg_fwd.items(): - source = source.replace(name, f"s{enc[0]}_{enc[1]}_c{enc[2]}_c{enc[3]}_{enc[4]}") + source = re.sub("\\b" + name + "\\b", f"s{enc[0]}_{enc[1]}_c{enc[2]}_c{enc[3]}_{enc[4]}", source) self.sfile = self._tmp + "b.S" with open(self.sfile, "w") as fd: