Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(&if -x): Conditional jump or move depends on uninitialised value(s) #352

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

wjrforcyber
Copy link
Contributor

@wjrforcyber wjrforcyber commented Dec 23, 2024

Fixed this using a short-circuit by swapping the second and third condition.
Valgrind log, before:

ABC command line: "read_aiger i10.aig; strash; &get; &if -x".

==44570== Conditional jump or move depends on uninitialised value(s)
==44570==    at 0x9DEBA1: Dau_DsdRemoveBraces (dauMerge.c:563)
==44570==    by 0x9D1F53: Dau_DsdDecompose (dauDsd.c:1926)
==44570==    by 0x835523: If_DsdManCompute (ifDsd.c:2073)
==44570==    by 0x84177C: If_ObjPerformMappingAnd (ifMap.c:315)
==44570==    by 0x843720: If_ManPerformMappingRound (ifMap.c:667)
==44570==    by 0x813A01: If_ManPerformMappingComb (ifCore.c:126)
==44570==    by 0x813C88: If_ManPerformMapping (ifCore.c:91)
==44570==    by 0xE5F147: Gia_ManPerformMappingInt (giaIf.c:2503)
==44570==    by 0xE60976: Gia_ManPerformMapping (giaIf.c:2566)
==44570==    by 0x543605: Abc_CommandAbc9If (abc.c:41910)
==44570==    by 0x654739: CmdCommandDispatch (cmdUtils.c:157)
==44570==    by 0x64E0F2: Cmd_CommandExecute (cmdApi.c:210)
==44570==
==44570==
==44570== HEAP SUMMARY:
==44570==     in use at exit: 0 bytes in 0 blocks
==44570==   total heap usage: 344,614 allocs, 344,614 frees, 32,395,015 bytes allocated
==44570==
==44570== All heap blocks were freed -- no leaks are possible
==44570==
==44570== Use --track-origins=yes to see where uninitialised values come from
==44570== For lists of detected and suppressed errors, rerun with: -s
==44570== ERROR SUMMARY: 206 errors from 1 contexts (suppressed: 0 from 0)

After:

ABC command line: "read_aiger i10.aig; strash; &get; &if -x".

==58058==
==58058== HEAP SUMMARY:
==58058==     in use at exit: 0 bytes in 0 blocks
==58058==   total heap usage: 344,614 allocs, 344,614 frees, 32,395,015 bytes allocated
==58058==
==58058== All heap blocks were freed -- no leaks are possible
==58058==
==58058== For lists of detected and suppressed errors, rerun with: -s
==58058== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

From Valgrind:
==44570== Conditional jump or move depends on uninitialised value(s)
==44570==    at 0x9DEBA1: Dau_DsdRemoveBraces (dauMerge.c:563)
==44570==    by 0x9D1F53: Dau_DsdDecompose (dauDsd.c:1926)
==44570==    by 0x835523: If_DsdManCompute (ifDsd.c:2073)
==44570==    by 0x84177C: If_ObjPerformMappingAnd (ifMap.c:315)
==44570==    by 0x843720: If_ManPerformMappingRound (ifMap.c:667)
==44570==    by 0x813A01: If_ManPerformMappingComb (ifCore.c:126)
==44570==    by 0x813C88: If_ManPerformMapping (ifCore.c:91)
==44570==    by 0xE5F147: Gia_ManPerformMappingInt (giaIf.c:2503)
==44570==    by 0xE60976: Gia_ManPerformMapping (giaIf.c:2566)
==44570==    by 0x543605: Abc_CommandAbc9If (abc.c:41910)
==44570==    by 0x654739: CmdCommandDispatch (cmdUtils.c:157)
==44570==    by 0x64E0F2: Cmd_CommandExecute (cmdApi.c:210)
@alanminko alanminko merged commit 943bc01 into berkeley-abc:master Dec 23, 2024
9 checks passed
@alanminko
Copy link
Contributor

Thank you for the fixes!

@wjrforcyber wjrforcyber deleted the conditional_jump branch December 25, 2024 07:53
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.

2 participants