From fdd66a8963939bd5a75bc519083f6106bfb934c8 Mon Sep 17 00:00:00 2001 From: wjrforcyber Date: Mon, 23 Dec 2024 23:24:47 +0800 Subject: [PATCH] Fix(&if -x): Conditional jump or move depends on uninitialised value(s) 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) --- src/opt/dau/dauMerge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opt/dau/dauMerge.c b/src/opt/dau/dauMerge.c index 0fbd126be..e4f7bedcc 100644 --- a/src/opt/dau/dauMerge.c +++ b/src/opt/dau/dauMerge.c @@ -560,7 +560,7 @@ void Dau_DsdRemoveBraces( char * pDsd, int * pMatches ) for ( q = p; *p; p++ ) if ( *p != ' ' ) { - if ( *p == '!' && *(q-1) == '!' && p != q ) + if ( *p == '!' && p != q && *(q-1) == '!' ) { q--; continue;