mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-15 13:21:14 +00:00
Adds copy constructor for class InstrBase
A copy constructor is necessarry for `class InstrBase`, as the implicit copy constructor simply copies the pointer `m_args`. This results in a double delete of the same memory region, causing a segmentation fault when rpcs3 exited.
This commit is contained in:
parent
7904d87ddd
commit
6906d146bb
@ -333,6 +333,17 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
InstrBase(const InstrBase &source)
|
||||
: InstrCaller<TO>(source)
|
||||
, m_name(source.m_name)
|
||||
, m_opcode(source.m_opcode)
|
||||
, m_args_count(source.m_args_count)
|
||||
, m_args(source.m_args_count ? new CodeFieldBase*[source.m_args_count] : nullptr)
|
||||
{
|
||||
for(int i = 0; i < source.m_args_count; ++i)
|
||||
m_args[i] = source.m_args[i];
|
||||
}
|
||||
|
||||
virtual ~InstrBase()
|
||||
{
|
||||
if (m_args) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user