From 63c3f48f4987b9684d7504d2dd934122fb783df8 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Wed, 29 Dec 2021 01:14:11 +0100 Subject: [PATCH] libgcc: Small __*divmoddi4 bug fix --- stage23/lib/libgcc.s2.asm32 | 6 ++++++ 1 file changed, 6 insertions(+) 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