You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In C++, a class member Machine::runUntilTime, whose type is int, won't be initialized automatically. The only place that sets runUntilTime is in Machine::Debugger(), but the snippet that invokes Debugger() checks the runUntilTime value first:
if (singleStep && (runUntilTime <= kernel->stats->totalTicks))
Debugger();
This leads to a used-before-set undefined behavior.
Suggested Solution
Initialize Machine::runUntilTime in the constructor Machine::Machine().
The text was updated successfully, but these errors were encountered:
Description
In C++, a class member
Machine::runUntilTime
, whose type isint
, won't be initialized automatically. The only place that setsrunUntilTime
is inMachine::Debugger()
, but the snippet that invokesDebugger()
checks therunUntilTime
value first:This leads to a used-before-set undefined behavior.
Suggested Solution
Initialize
Machine::runUntilTime
in the constructorMachine::Machine()
.The text was updated successfully, but these errors were encountered: