summaryrefslogtreecommitdiffstats
path: root/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c
diff options
context:
space:
mode:
Diffstat (limited to 'EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c')
-rw-r--r--EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c b/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c
index 4b020cb6da..174e774de3 100644
--- a/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c
+++ b/EdkModulePkg/Universal/Ebc/Dxe/EbcExecute.c
@@ -22,11 +22,6 @@ Abstract:
#include "EbcInt.h"
#include "EbcExecute.h"
-//
-// VM major/minor version
-//
-#define VM_MAJOR_VERSION 1
-#define VM_MINOR_VERSION 0
//
// Define some useful data size constants to allow switch statements based on
@@ -763,10 +758,15 @@ Returns:
EbcDebugSignalException (EXCEPT_EBC_STACK_FAULT, EXCEPTION_FLAG_FATAL, VmPtr);
StackCorrupted = 1;
}
+ if (!StackCorrupted && ((UINT64)VmPtr->R[0] <= (UINT64)(UINTN) VmPtr->StackTop)) {
+ EbcDebugSignalException (EXCEPT_EBC_STACK_FAULT, EXCEPTION_FLAG_FATAL, VmPtr);
+ StackCorrupted = 1;
+ }
}
Done:
mVmPtr = NULL;
+
return Status;
}
@@ -1122,10 +1122,6 @@ Returns:
EXCEPTION_FLAG_NONE,
VmPtr
);
- //
- // Don't advance the IP
- //
- return EFI_UNSUPPORTED;
break;
//
@@ -4504,19 +4500,8 @@ Returns:
adjust for the stack gap and return the modified address.
--*/
-{
- if ((Addr >= VmPtr->LowStackTop) && (Addr < VmPtr->HighStackBottom)) {
- //
- // In the stack gap -- now make sure it's not in the VM itself, which
- // would be the case if it's accessing VM register contents.
- //
- if ((Addr < (UINTN) VmPtr) || (Addr > (UINTN) VmPtr + sizeof (VM_CONTEXT))) {
- VmPtr->LastAddrConverted = Addr;
- VmPtr->LastAddrConvertedValue = Addr - VmPtr->LowStackTop + VmPtr->HighStackBottom;
- return Addr - VmPtr->LowStackTop + VmPtr->HighStackBottom;
- }
- }
-
+{
+ ASSERT(((Addr < VmPtr->LowStackTop) || (Addr > VmPtr->HighStackBottom)));
return Addr;
}