diff options
author | Patryk Obara <dreamer.tan@gmail.com> | 2021-08-12 15:51:40 +0300 |
---|---|---|
committer | Patryk Obara <dreamer.tan@gmail.com> | 2021-08-12 15:51:40 +0300 |
commit | bfd3930a6e97574180c0501177ed8b07252cacc0 (patch) | |
tree | 2351de5945c4cc4be863cda7a4b124bf1ad9ceea | |
parent | 85cfebdc879594d3ba224c2c435e156326d2e30e (diff) | |
parent | 7a8a7ba3826fa43ae8a644c8847bcd7a9e5aaebd (diff) |
Merge branch 'svn/trunk'po/merge-4465
-rw-r--r-- | src/cpu/core_dyn_x86.cpp | 9 | ||||
-rw-r--r-- | src/cpu/core_dyn_x86/decoder.h | 9 | ||||
-rw-r--r-- | src/cpu/core_dynrec/decoder.h | 6 | ||||
-rw-r--r-- | src/cpu/core_dynrec/decoder_opcodes.h | 1 | ||||
-rw-r--r-- | src/cpu/core_full/load.h | 1 | ||||
-rw-r--r-- | src/cpu/core_normal/prefix_66.h | 3 | ||||
-rw-r--r-- | src/cpu/core_normal/prefix_none.h | 3 | ||||
-rw-r--r-- | src/debug/debug_win32.cpp | 3 | ||||
-rw-r--r-- | src/dos/dos_execute.cpp | 2 |
9 files changed, 16 insertions, 21 deletions
diff --git a/src/cpu/core_dyn_x86.cpp b/src/cpu/core_dyn_x86.cpp index 02d31f868..87fc02754 100644 --- a/src/cpu/core_dyn_x86.cpp +++ b/src/cpu/core_dyn_x86.cpp @@ -116,9 +116,6 @@ enum BlockReturn { BR_Cycles, BR_Link1,BR_Link2, BR_Opcode, -#if (C_DEBUG) - BR_OpcodeFull, -#endif BR_Iret, BR_CallBack, BR_SMCBlock @@ -353,12 +350,6 @@ run_block: CPU_CycleLeft+=CPU_Cycles; CPU_Cycles=1; return CPU_Core_Normal_Run(); -#if (C_DEBUG) - case BR_OpcodeFull: - CPU_CycleLeft+=CPU_Cycles; - CPU_Cycles=1; - return CPU_Core_Full_Run(); -#endif case BR_Link1: case BR_Link2: { diff --git a/src/cpu/core_dyn_x86/decoder.h b/src/cpu/core_dyn_x86/decoder.h index d41323390..092f1e5dc 100644 --- a/src/cpu/core_dyn_x86/decoder.h +++ b/src/cpu/core_dyn_x86/decoder.h @@ -2427,6 +2427,7 @@ restart_prefix: /* LEA Gv */ case 0x8d: dyn_get_modrm(); + if (GCC_UNLIKELY(decode.modrm.mod==3)) goto illegalopcode; if (decode.big_op) { dyn_fill_ea(false,&DynRegs[decode.modrm.reg]); } else { @@ -2891,14 +2892,6 @@ illegalopcode: dyn_closeblock(); goto finish_block; -#if (C_DEBUG) - dyn_set_eip_last(); - dyn_reduce_cycles(); - dyn_save_critical_regs(); - gen_return(BR_OpcodeFull); - dyn_closeblock(); - goto finish_block; -#endif finish_block: /* Setup the correct end-address */ decode.active_block->page.end=--decode.page.index; diff --git a/src/cpu/core_dynrec/decoder.h b/src/cpu/core_dynrec/decoder.h index 29a41a7dd..75f0aa0ae 100644 --- a/src/cpu/core_dynrec/decoder.h +++ b/src/cpu/core_dynrec/decoder.h @@ -331,7 +331,11 @@ restart_prefix: case 0x8c:dyn_mov_ev_seg();break; // load effective address - case 0x8d:dyn_lea();break; + case 0x8d: + dyn_get_modrm(); + if (GCC_UNLIKELY(decode.modrm.mod==3)) goto illegalopcode; + dyn_lea(); + break; // move a value from memory or a 16bit register into a segment register case 0x8e:dyn_mov_seg_ev();break; diff --git a/src/cpu/core_dynrec/decoder_opcodes.h b/src/cpu/core_dynrec/decoder_opcodes.h index ca8b9db7c..38657b388 100644 --- a/src/cpu/core_dynrec/decoder_opcodes.h +++ b/src/cpu/core_dynrec/decoder_opcodes.h @@ -394,7 +394,6 @@ static void dyn_mov_ev_seg(void) { static void dyn_lea(void) { - dyn_get_modrm(); dyn_fill_ea(FC_ADDR,false); MOV_REG_WORD_FROM_HOST_REG(FC_ADDR,decode.modrm.reg,decode.big_op); } diff --git a/src/cpu/core_full/load.h b/src/cpu/core_full/load.h index 6d8c0fd21..3d08b02c0 100644 --- a/src/cpu/core_full/load.h +++ b/src/cpu/core_full/load.h @@ -182,6 +182,7 @@ l_M_Ed: inst_op2_d=LoadMw(inst.rm_eaa+4); break; case M_EA: + if (inst.rm>=0xc0) goto illegalopcode; inst_op1_d=inst.rm_off; break; case M_POPw: diff --git a/src/cpu/core_normal/prefix_66.h b/src/cpu/core_normal/prefix_66.h index d9bb1c60c..fac69badf 100644 --- a/src/cpu/core_normal/prefix_66.h +++ b/src/cpu/core_normal/prefix_66.h @@ -339,8 +339,9 @@ } CASE_D(0x8d) /* LEA Gd */ { - //Little hack to always use segprefixed version GetRMrd; + if (rm >= 0xc0) goto illegal_opcode; + //Little hack to always use segprefixed version BaseDS=BaseSS=0; if (TEST_PREFIX_ADDR) { *rmrd=(Bit32u)(*EATable[256+rm])(); diff --git a/src/cpu/core_normal/prefix_none.h b/src/cpu/core_normal/prefix_none.h index 256b09cff..cd201257e 100644 --- a/src/cpu/core_normal/prefix_none.h +++ b/src/cpu/core_normal/prefix_none.h @@ -492,9 +492,10 @@ } CASE_W(0x8d) /* LEA Gw */ { + GetRMrw; + if (rm >= 0xc0) goto illegal_opcode; //Little hack to always use segprefixed version BaseDS=BaseSS=0; - GetRMrw; if (TEST_PREFIX_ADDR) { *rmrw=(Bit16u)(*EATable[256+rm])(); } else { diff --git a/src/debug/debug_win32.cpp b/src/debug/debug_win32.cpp index b27cb4037..5be531311 100644 --- a/src/debug/debug_win32.cpp +++ b/src/debug/debug_win32.cpp @@ -77,6 +77,9 @@ void WIN32_Console() { AllocConsole(); SetConsoleTitle("DOSBox Debugger"); ResizeConsole(GetStdHandle(STD_OUTPUT_HANDLE),80,50); + HWND hWnd = GetConsoleWindow(); + SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) & + ~(WS_SIZEBOX | WS_MAXIMIZEBOX | WS_VSCROLL | WS_HSCROLL )); } #endif #endif diff --git a/src/dos/dos_execute.cpp b/src/dos/dos_execute.cpp index 312a8fde3..e9e125061 100644 --- a/src/dos/dos_execute.cpp +++ b/src/dos/dos_execute.cpp @@ -423,6 +423,8 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) { csip=RealMake(loadseg+head.initCS,head.initIP); sssp=RealMake(loadseg+head.initSS,head.initSP); if (head.initSP<4) LOG(LOG_EXEC,LOG_ERROR)("stack underflow/wrap at EXEC"); + if ((pspseg+memsize)<(loadseg+head.initSS+(head.initSP>>4))) + LOG(LOG_EXEC,LOG_ERROR)("stack outside memory block at EXEC"); Program::ResetLastWrittenChar('\0'); // triggers newline injection after DOS programs } |