Skip to content

Commit

Permalink
feat(instruction): increase accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed May 20, 2024
1 parent d9998ed commit 3b3f5b1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/lime/instruction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace lime

public:
[[nodiscard]] std::optional<instruction> next() const;
[[lime::inaccurate]] [[nodiscard]] std::optional<instruction> prev() const;
[[nodiscard]] std::optional<instruction> prev() const;

public:
[[nodiscard]] std::optional<instruction> follow() const;
Expand Down
17 changes: 16 additions & 1 deletion src/instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,22 @@ namespace lime

const auto next = instruction->next();

if (!next || next->addr() != m_impl->address)
if (!next)
{
continue;
}

if (next->addr() != m_impl->address)
{
continue;
}

if (next->size() != size())
{
continue;
}

if (next->mnemonic() != mnemonic())
{
continue;
}
Expand Down

0 comments on commit 3b3f5b1

Please sign in to comment.