[SOFT386]

Fix a bug in Soft386ExceptionWithErrorCode. The instruction pointer exceptions can
return to should point to the instruction that caused the exception.


svn path=/branches/ntvdm/; revision=60603
This commit is contained in:
Aleksandar Andrejevic 2013-10-11 12:24:05 +00:00
parent b22da55f8f
commit 800969b126
3 changed files with 7 additions and 1 deletions

View file

@ -319,7 +319,7 @@ struct _SOFT386_STATE
SOFT386_BOP_PROC BopCallback;
SOFT386_REG GeneralRegs[SOFT386_NUM_GEN_REGS];
SOFT386_SEG_REG SegmentRegs[SOFT386_NUM_SEG_REGS];
SOFT386_REG InstPtr;
SOFT386_REG InstPtr, SavedInstPtr;
SOFT386_FLAGS_REG Flags;
SOFT386_TABLE_REG Gdtr, Idtr, Ldtr, Tss;
ULONGLONG TimeStampCounter;

View file

@ -469,6 +469,9 @@ Soft386ExceptionWithErrorCode(PSOFT386_STATE State,
return;
}
/* Restore the IP to the saved IP */
State->InstPtr = State->SavedInstPtr;
if (!Soft386GetIntVector(State, ExceptionCode, &IdtEntry))
{
/*

View file

@ -56,6 +56,9 @@ Soft386ExecutionControl(PSOFT386_STATE State, INT Command)
/* Main execution loop */
do
{
/* If this is a new instruction, save the IP */
if (State->PrefixFlags == 0) State->SavedInstPtr = State->InstPtr;
/* Perform an instruction fetch */
if (!Soft386FetchByte(State, &Opcode)) continue;