Skip to content

Commit

Permalink
Fix offset into array in set_bits_r
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Aug 4, 2024
1 parent 2b4e0c1 commit b448300
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/huffman/set_bits_r.asm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ _huff_setbits_r:
je ._huff_setbits_r_no_leaf1_recursion

; &m_aNodes[pNode->m_aLeafs[1]]
lea rax, [huff_nodes + rcx]
mov rbx, rcx
imul rbx, HUFF_CNODE_SIZE
lea rax, [huff_nodes + rbx]

; bits | (1<<Depth)
mov r9, 1
Expand All @@ -81,7 +83,9 @@ _huff_setbits_r:
je ._huff_setbits_r_no_leaf0_recursion

; &m_aNodes[pNode->m_aLeafs[0]]
lea rax, [huff_nodes + rcx]
mov rbx, rcx
imul rbx, HUFF_CNODE_SIZE
lea rax, [huff_nodes + rbx]

; bits are still in rdi

Expand Down

0 comments on commit b448300

Please sign in to comment.