Skip to content

Commit

Permalink
Fix malloc bug preventing fs_JoinPath from working sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
beckadamtheinventor committed Mar 7, 2024
1 parent 56f930d commit 0c84a61
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sys/Malloc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sys_Malloc:
ld c,malloc_block_size_bits
call ti._ishru ; size to malloc / malloc_block_size
inc hl
ex hl,de
push hl
ld hl,malloc_cache
ld bc,malloc_cache_len
.loop:
Expand All @@ -35,6 +35,7 @@ sys_Malloc:
.checklen:
dec hl
ld (ScrapMem),hl
pop de ; restore number of blocks to malloc
push de
dec de
ld a,e
Expand Down Expand Up @@ -67,7 +68,7 @@ end repeat
ld (hl),a
inc hl

pop bc
pop bc ; pop number of blocks to malloc off the stack
dec bc
ld a,b
or a,c
Expand Down

0 comments on commit 0c84a61

Please sign in to comment.