Skip to content

ArchPcode doesn't return the right ret_offset #303

@DanielBotnik

Description

@DanielBotnik

Description

from archinfo import ArchPcode
arch = ArchPcode("MIPS:LE:32:default")
print(arch.register_names[arch.ret_offset])
'f0'

While the result should be v0.

I think it because in the .cspec file, we can see that f0_1 comes before v0

<output>
        <pentry minsize="1" maxsize="8" metatype="float">
          <register name="f0_1"/>
        </pentry>
        <pentry minsize="1" maxsize="4">
          <register name="v0"/>
        </pentry>
		    <pentry minsize="5" maxsize="8">
          <addr space="join" piece1="v1" piece2="v0"/>
        </pentry>
</output>

I think a quick fix will be to select the tag that doesn't have metatype value, but I am not sure if its the right solution

Steps to reproduce the bug

No response

Environment

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions