Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPUAnalyser: fix std::move misuse #14011

Merged
merged 1 commit into from Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion rpcs3/Crypto/decrypt_binaries.cpp
Expand Up @@ -75,7 +75,6 @@ usz decrypt_binaries_t::decrypt(std::string klic_input)

fs::file elf_file;

bool tried = false;
bool invalid = false;
usz key_it = 0;
u32 file_magic{};
Expand Down
46 changes: 23 additions & 23 deletions rpcs3/Emu/Cell/PPUAnalyser.cpp
Expand Up @@ -1008,11 +1008,11 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
add_toc(toc);
add_func(func.addr, toc, 0);
}
else if (new_func.toc - func.toc != toc_add)
{
//func.toc = -1;
//new_func.toc = -1;
}
//else if (new_func.toc - func.toc != toc_add)
//{
// func.toc = -1;
// new_func.toc = -1;
//}

if (new_func.blocks.empty())
{
Expand Down Expand Up @@ -1055,11 +1055,11 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
add_toc(toc);
add_func(func.addr, toc, 0);
}
else if (new_func.toc - func.toc != toc_add)
{
//func.toc = -1;
//new_func.toc = -1;
}
//else if (new_func.toc - func.toc != toc_add)
//{
// func.toc = -1;
// new_func.toc = -1;
//}

if (new_func.blocks.empty())
{
Expand Down Expand Up @@ -1472,7 +1472,8 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
{
break;
}
else if (addr == start && op.opcode == ppu_instructions::NOP())

if (addr == start && op.opcode == ppu_instructions::NOP())
{
if (start == func.addr + func.size)
{
Expand All @@ -1483,16 +1484,19 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
start += 4;
continue;
}
else if (type == ppu_itype::SC && op.opcode != ppu_instructions::SC(0))

if (type == ppu_itype::SC && op.opcode != ppu_instructions::SC(0))
{
break;
}
else if (addr == start && op.opcode == ppu_instructions::BLR())

if (addr == start && op.opcode == ppu_instructions::BLR())
{
start += 4;
continue;
}
else if (type == ppu_itype::B || type == ppu_itype::BC)

if (type == ppu_itype::B || type == ppu_itype::BC)
{
const u32 target = (op.aa ? 0 : addr) + (type == ppu_itype::B ? +op.bt24 : +op.bt14);

Expand Down Expand Up @@ -1539,7 +1543,7 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
end = 0;
}

for (auto&& [_, func] : as_rvalue(std::move(fmap)))

This comment was marked as resolved.

for (auto&& [_, func] : as_rvalue(fmap))
{
if (func.attr & ppu_attr::no_size && entry)
{
Expand All @@ -1560,7 +1564,7 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
continue;
}

for (auto [addr, size] : func.blocks)
for (const auto& [addr, size] : func.blocks)
{
if (!size)
{
Expand Down Expand Up @@ -1598,7 +1602,7 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
for (auto& rel : this->relocs)
{
// Disabled (TODO)
if (1 || !vm::check_addr<4>(rel.addr))
//if (!vm::check_addr<4>(rel.addr))
{
continue;
}
Expand Down Expand Up @@ -1722,9 +1726,7 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
break;
}

const auto found = fmap.find(target);

if (target != i_pos && found == fmap.cend())
if (target != i_pos && !fmap.contains(target))
{
if (block_set.count(target) == 0)
{
Expand Down Expand Up @@ -1782,9 +1784,7 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
else if (is_good && is_fallback && lim < end)
{
// Register fallback target
const auto found = fmap.find(lim);

if (found == fmap.cend() && block_set.count(lim) == 0)
if (!fmap.contains(lim) && !block_set.contains(lim))
{
ppu_log.trace("Block target found: 0x%x (i_pos=0x%x)", lim, i_pos);
block_queue.emplace_back(lim, 0);
Expand Down
4 changes: 1 addition & 3 deletions rpcs3/Emu/Cell/lv2/sys_lwcond.cpp
@@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.h"
#include "sys_lwcond.h"

#include "Emu/IdManager.h"
Expand Down Expand Up @@ -566,8 +566,6 @@ error_code _sys_lwcond_queue_wait(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id
{
if (lv2_obj::wait_timeout(timeout, &ppu))
{
const u64 start_time = ppu.start_time;

// Wait for rescheduling
if (ppu.check_state())
{
Expand Down