Skip to content

Commit 7d3edde

Browse files
committed
Copy register state when forking
1 parent fec69a6 commit 7d3edde

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/tinykvm/machine.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ Machine::Machine(const Machine& other, const MachineOptions& options)
9797
m_mt.reset(new MultiThreading{*this});
9898
m_mt->reset_to(*other.m_mt);
9999
}
100+
101+
/* Copy register state from the master machine */
102+
auto& m_regs = other.registers();
103+
this->set_registers(m_regs);
104+
this->set_fpu_registers(other.fpu_registers());
100105
}
101106

102107
__attribute__ ((cold))

0 commit comments

Comments
 (0)