https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0c34c067c461d00c290e7…
commit 0c34c067c461d00c290e76e8066b226e47eeec43
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Tue Mar 9 19:41:15 2021 +0100
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Tue Mar 9 19:42:49 2021 +0100
[CRT] Add CFI annotatiions to memmove function
---
sdk/lib/crt/mem/i386/memmove_asm.s | 41 ++++++++++++++++++++++++++------------
1 file changed, 28 insertions(+), 13 deletions(-)
diff --git a/sdk/lib/crt/mem/i386/memmove_asm.s b/sdk/lib/crt/mem/i386/memmove_asm.s
index 299b2cc8d38..35b0ee37566 100644
--- a/sdk/lib/crt/mem/i386/memmove_asm.s
+++ b/sdk/lib/crt/mem/i386/memmove_asm.s
@@ -14,15 +14,20 @@ _memcpy:
FUNC _memmove
FPO 0, 3, 5, 2, 1, FRAME_NONFPO
push ebp
+ CFI_ADJUST_CFA_OFFSET 4
+ CFI_REL_OFFSET ebp, 0
mov ebp, esp
-
+ CFI_DEF_CFA_REGISTER ebp
+
push esi
+ CFI_REL_OFFSET esi, -4
push edi
-
+ CFI_REL_OFFSET edi, -8
+
mov edi, [ebp + 8]
mov esi, [ebp + 12]
mov ecx, [ebp + 16]
-
+
cmp edi, esi
jbe .CopyUp
mov eax, ecx
@@ -30,9 +35,9 @@ FUNC _memmove
cmp edi, eax
jb .CopyDown
-.CopyUp:
+.CopyUp:
cld
-
+
cmp ecx, 16
jb .L1
mov edx, ecx
@@ -53,29 +58,34 @@ FUNC _memmove
rep movsd
mov ecx, edx
and ecx, 3
-.L1:
+.L1:
test ecx, ecx
je .L3
rep movsb
.L3:
mov eax, [ebp + 8]
pop edi
+ CFI_SAME_VALUE edi
pop esi
+ CFI_SAME_VALUE esi
leave
+ CFI_ADJUST_CFA_OFFSET -4
+ CFI_SAME_VALUE ebp
+ CFI_DEF_CFA_REGISTER esp
ret
.CopyDown:
std
-
+
add edi, ecx
add esi, ecx
-
+
cmp ecx, 16
jb .L4
mov edx, ecx
test edi, 3
je .L5
-
+
/*
* Make the destination dword aligned
*/
@@ -86,10 +96,10 @@ FUNC _memmove
dec edi
rep movsb
mov ecx, edx
-
+
sub esi, 3
sub edi, 3
-.L6:
+.L6:
shr ecx, 2
rep movsd
mov ecx, edx
@@ -97,14 +107,19 @@ FUNC _memmove
je .L7
add esi, 3
add edi, 3
-.L8:
+.L8:
rep movsb
.L7:
cld
mov eax, [ebp + 8]
pop edi
+ CFI_SAME_VALUE edi
pop esi
+ CFI_SAME_VALUE esi
leave
+ CFI_ADJUST_CFA_OFFSET -4
+ CFI_SAME_VALUE ebp
+ CFI_DEF_CFA_REGISTER esp
ret
.L5:
sub edi, 4
@@ -113,7 +128,7 @@ FUNC _memmove
.L4:
test ecx, ecx
- je .L7
+ je .L7
dec esi
dec edi
jmp .L8