diff options
-rw-r--r-- | CHANGELOG.txt | 4 | ||||
-rw-r--r-- | zap/source/amd64/mem/fill.s | 36 |
2 files changed, 22 insertions, 18 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 098834a..547e7ea 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,7 @@ +# 16.7 + +* Fix segmentation fault in fill caused by usage of wrong register (amd64); + # 16.6 * cp: Use vmovdqu instead of vmovups (amd64); diff --git a/zap/source/amd64/mem/fill.s b/zap/source/amd64/mem/fill.s index 7edd36b..8e3f5fd 100644 --- a/zap/source/amd64/mem/fill.s +++ b/zap/source/amd64/mem/fill.s @@ -7,29 +7,29 @@ .globl zap_fill zap_fill: - movzx rsi,sil # zap_i04 extval = val; - mov rax,0x0101010101010101 # zap_i04 val = 0x0101010101010101u; - imul rax,rsi # val *= extval; + movzx rsi,sil # zap_i04 extval = val; + mov rax,0x0101010101010101 # zap_i04 val = 0x0101010101010101u; + imul rax,rsi # val *= extval; -.wrdfill: # wrdfill:; - cmp rdx,0x8 - jl short .bytefill # if (num < 0x8u) goto bytefill; +.wrdfill: # wrdfill:; + cmp rdx,0x8 + jl short .bytefill # if (num < 0x8u) goto bytefill; - mov [rdi],rax # *(zap_i04 *)dest = val8; + mov [rdi],rax # *(zap_i04 *)dest = val8; - add rdi,0x8 # dest += 0x8u; - sub rdx,0x8 # num -= 0x8u; - jmp short .wrdfill # goto wrdfill + add rdi,0x8 # dest += 0x8u; + sub rdx,0x8 # num -= 0x8u; + jmp short .wrdfill # goto wrdfill -.bytefill: # bytefill:; - test rdx,rdx # if (rem == 0x0) - jz short .done # goto done +.bytefill: # bytefill:; + test rdx,rdx # if (rem == 0x0) + jz short .done # goto done - mov [rsi],al # *(zap_i8 *)dest = val1; + mov [rdi],al # *(zap_i8 *)dest = val1; - inc rdi # ++dest; - dec rdx # --rem; - jmp short .bytefill # goto bytefill; + inc rdi # ++dest; + dec rdx # --rem; + jmp short .bytefill # goto bytefill; .done: - ret # return + ret # return |