:: commit 4d7d9e9c1abe2fdc881f39c575ca42a521d4b748

mintsuki <mintsuki@protonmail.com> — 2021-12-29 00:14

parents: 00f7b00cf6

libgcc: Small __*divmoddi4 bug fix

diff --git a/stage23/lib/libgcc.s2.asm32 b/stage23/lib/libgcc.s2.asm32
index 743f11f8..30575bbe 100644
--- a/stage23/lib/libgcc.s2.asm32
+++ b/stage23/lib/libgcc.s2.asm32
@@ -40,8 +40,11 @@ __udivmoddi4:
     mov edx, dword [esp+8]
     div dword [esp+12]
     mov ecx, dword [esp+20]
+    test ecx, ecx
+    jz .done
     mov dword [ecx], edx
     mov dword [ecx+4], 0
+  .done:
     xor edx, edx
     ret
 
@@ -51,7 +54,10 @@ __divmoddi4:
     mov edx, dword [esp+8]
     idiv dword [esp+12]
     mov ecx, dword [esp+20]
+    test ecx, ecx
+    jz .done
     mov dword [ecx], edx
     mov dword [ecx+4], 0
+  .done:
     xor edx, edx
     ret
tab: 248 wrap: offon