Browse Source

[dynarmic] fix assert for referencing a non-initialized part of the boost::stable_vector container (#2940)

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2940
Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
pull/2948/head
lizzie 2 months ago
committed by crueter
parent
commit
dd24ef244d
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 4
      src/dynarmic/src/dynarmic/ir/basic_block.cpp

4
src/dynarmic/src/dynarmic/ir/basic_block.cpp

@ -44,13 +44,13 @@ Block::iterator Block::PrependNewInst(iterator insertion_point, Opcode opcode, s
// hugely benefit from the coherency of faster allocations...
IR::Inst* inst;
if (inlined_inst.size() < inlined_inst.max_size()) {
inst = &inlined_inst[inlined_inst.size()];
inlined_inst.emplace_back(opcode);
inst = &inlined_inst[inlined_inst.size() - 1];
} else {
if (pooled_inst.empty() || pooled_inst.back().size() == pooled_inst.back().max_size())
pooled_inst.emplace_back();
inst = &pooled_inst.back()[pooled_inst.back().size()];
pooled_inst.back().emplace_back(opcode);
inst = &pooled_inst.back()[pooled_inst.back().size() - 1];
}
DEBUG_ASSERT(args.size() == inst->NumArgs());
std::for_each(args.begin(), args.end(), [&inst, index = size_t(0)](const auto& arg) mutable {

Loading…
Cancel
Save