summaryrefslogtreecommitdiff
path: root/packaging/0003-Fix-Linux-x86-FuncEvalHijack-stack-alignment-17143.patch
blob: 5d98ceeb6f5c7fecf03b0eb67986290f039d9aff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 2a6ac3cb557019c31d70510cf0ce5277d3eedd6d Mon Sep 17 00:00:00 2001
From: Igor Kulaychuk <igor.kulaychuk@gmail.com>
Date: Fri, 23 Mar 2018 14:12:54 +0300
Subject: [PATCH 3/5] Fix Linux/x86 FuncEvalHijack stack alignment (#17143)

---
 src/debug/ee/i386/dbghelpers.S | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/debug/ee/i386/dbghelpers.S b/src/debug/ee/i386/dbghelpers.S
index d0a1101..f15ca5a 100644
--- a/src/debug/ee/i386/dbghelpers.S
+++ b/src/debug/ee/i386/dbghelpers.S
@@ -9,10 +9,14 @@
 
 // @dbgtodo- once we port Funceval, use the ExceptionHijack stub instead of this func-eval stub.
 NESTED_ENTRY FuncEvalHijack, _TEXT, UnhandledExceptionHandlerUnix
+#define STK_ALIGN_PADDING 12
+        sub  esp, STK_ALIGN_PADDING
         push eax        // the ptr to the DebuggerEval
+        CHECK_STACK_ALIGNMENT
         call C_FUNC(FuncEvalHijackWorker)
+        add  esp, (4 + STK_ALIGN_PADDING)
         jmp  eax        // return is the patch addresss to jmp to
-
+#undef STK_ALIGN_PADDING
 NESTED_END FuncEvalHijack, _TEXT
 
 //
-- 
2.7.4