Skip to content

Commit

Permalink
Modules/CodeSelection: Minor simplification
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Wang <[email protected]>
  • Loading branch information
aesophor committed Jul 21, 2022
1 parent 25c5f97 commit 8efbd43
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Modules/CodeSelection/CodeSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ CodeSelection::CodeSelection()

CodeSelection::SymMemRegMap CodeSelection::initSymMemRegMap() {
return {
{ "printf", { /* check the first six args */ } },
{ "lstat", { Register::X64::RDI } },
{ "perror", { Register::X64::RDI } },
{ "lstat", { Register::X64::RDI } },
{ "perror", { Register::X64::RDI } },
};
}

Expand Down Expand Up @@ -195,7 +194,7 @@ CodeSelection::Argv CodeSelection::decideArgv(const std::string &symbol) const {
// However, if we already know which arguments are pointers,
// then we only need to check those arguments.
auto it = m_symMemRegMap.find(symbol);
return (it != m_symMemRegMap.end() && it->second.size()) ? it->second : ret;
return it != m_symMemRegMap.end() ? it->second : ret;
}

uint64_t CodeSelection::getSymBlockLen(S2EExecutionState *state, uint64_t ptr) const {
Expand Down

0 comments on commit 8efbd43

Please sign in to comment.