Skip to content

Commit e83c36e

Browse files
committed
Fix msan uninitialized-read error in sstring.c
With msan and fpesan, msan detects that XS->C is not initialized. I'm not sure why we need fpesan, but maybe it's necessary to block an optimization. (My test is too large to run without -O2.)
1 parent c884a9c commit e83c36e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

testu01/sstring.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,15 @@ static sstring_Corr * CreateCorr (int s)
324324

325325
XS = corr->Corr[0] = util_Malloc (sizeof (struct InfoListC));
326326
XS->Nb = 0;
327+
XS->C = 0;
327328
XS->Pop = 1;
328329
XS->Ext = NULL;
329330
XS->Ext0 = NULL;
330331
XS->Next = NULL;
331332

332333
XS = corr->Corr[1] = util_Malloc (sizeof (struct InfoListC));
333334
XS->Nb = 1;
335+
XS->C = 0;
334336
bitset_SetBit (XS->C, 0);
335337
XS->Pop = 2;
336338
XS->Ext = NULL;

0 commit comments

Comments
 (0)