Skip to content

Fix ccall type-punning and mcall division by zero#2530

Open
sirus20x6 wants to merge 1 commit intosamtools:developfrom
sirus20x6:fix/ccall-mcall-bugs
Open

Fix ccall type-punning and mcall division by zero#2530
sirus20x6 wants to merge 1 commit intosamtools:developfrom
sirus20x6:fix/ccall-mcall-bugs

Conversation

@sirus20x6
Copy link

Summary

  • Fix tmpi declaration from float to int32_t in ccall.c — was passed to bcf_update_info_int32 which interpreted float bit pattern as garbage integer for CLR tag
  • Add zero-denominator guard in mcall.c before dividing by sum of DP4 counts — produces mq = 0 when depth is zero, matching the pattern in test16_core

Test plan

  • Existing test suite passes (1920/1920)
  • Verify CLR INFO tag contains correct integer values after consensus calling

ccall.c: Change `tmpi` from float to int32_t so that
bcf_update_info_int32() receives actual integer bits instead of
reinterpreting float bits as an int32.

mcall.c: Guard the MQ calculation against division by zero when all
DP4 counts are zero, consistent with the existing check in
test16_core().
@sirus20x6 sirus20x6 force-pushed the fix/ccall-mcall-bugs branch from 1127269 to ae662c5 Compare March 26, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant