FIXME's from static analysis

This commit is contained in:
dwarning 2023-06-14 22:31:07 +02:00
parent f306e1c420
commit e79d31853e
4 changed files with 10 additions and 10 deletions

View File

@ -202,7 +202,7 @@ int AllocatedSize;
Matrix->FillinsRemaining = 0;
RecordAllocation( Matrix, (void *)Matrix );
if (Matrix->Error == spNO_MEMORY) goto MemoryError;
if (Matrix->Error == spNO_MEMORY) goto MemoryError; /* FIXME: Use of memory after free */
/* Take out the trash. */
Matrix->TrashCan.Real = 0.0;

View File

@ -185,7 +185,7 @@ spFindElement(
)
{
register ElementPtr pElement;
int StartAt;
int StartAt = 0;
long int Min = LARGEST_LONG_INTEGER;
#define BorderRight 0 /* Start at left border, move right. */
#define BorderDown 1 /* Start at top border, move down. */

View File

@ -377,7 +377,7 @@ RealNumber Mult;
/* Update column. */
pColumn = Matrix->FirstInCol[Step];
while (pColumn->Row < Step)
while (pColumn->Row < Step) /* FIXME: Access to Row results in dereference of NULL pointer */
{ pElement = Matrix->Diag[pColumn->Row];
pColumn->Real = Dest[pColumn->Row] * pElement->Real;
while ((pElement = pElement->NextInCol) != NULL)
@ -409,7 +409,7 @@ RealNumber Mult;
/* Update column. */
pColumn = Matrix->FirstInCol[Step];
while (pColumn->Row < Step)
while (pColumn->Row < Step) /* FIXME: Access to Row results in dereference of NULL pointer */
{ pElement = Matrix->Diag[pColumn->Row];
Mult = (*pDest[pColumn->Row] *= pElement->Real);
while ((pElement = pElement->NextInCol) != NULL)
@ -486,7 +486,7 @@ ComplexNumber Mult, Pivot;
/* Update column. */
pColumn = Matrix->FirstInCol[Step];
while (pColumn->Row < Step)
while (pColumn->Row < Step) /* FIXME: Access to Row results in dereference of NULL pointer */
{ pElement = Matrix->Diag[pColumn->Row];
/* Cmplx expr: Mult = Dest[pColumn->Row] * (1.0 / *pPivot). */
CMPLX_MULT(Mult, Dest[pColumn->Row], *pElement);
@ -524,7 +524,7 @@ ComplexNumber Mult, Pivot;
/* Update column. */
pColumn = Matrix->FirstInCol[Step];
while (pColumn->Row < Step)
while (pColumn->Row < Step) /* FIXME: Access to Row results in dereference of NULL pointer */
{ pElement = Matrix->Diag[pColumn->Row];
/* Cmplx expr: Mult = *pDest[pColumn->Row] * (1.0 / *pPivot). */
CMPLX_MULT(Mult, *pDest[pColumn->Row], *pElement);
@ -656,7 +656,7 @@ BOOLEAN *DoRealDirect;
}
pColumn = Matrix->FirstInCol[Step];
while (pColumn->Row < Step)
while (pColumn->Row < Step) /* FIXME: Access to Row results in dereference of NULL pointer */
{ pElement = Matrix->Diag[pColumn->Row];
Nm[Step]++;
while ((pElement = pElement->NextInCol) != NULL)
@ -2530,7 +2530,7 @@ register ElementPtr pElement;
pElement = *ElementAboveRow2;
} while (pElement->Row < Row2);
ElementBelowRow2 = Element2->NextInCol;
ElementBelowRow2 = Element2->NextInCol;/* FIXME: ElementBelowRow2 is never read */
/* Move Element2 to Row1. */
*ElementAboveRow2 = Element2->NextInCol;
@ -2675,7 +2675,7 @@ register ElementPtr pElement;
pElement = *ElementLeftOfCol2;
} while (pElement->Col < Col2);
ElementRightOfCol2 = Element2->NextInRow;
ElementRightOfCol2 = Element2->NextInRow; /* FIXME: ElementRightOfCol2 is never read */
/* Move Element2 to Col1. */
*ElementLeftOfCol2 = Element2->NextInRow;

View File

@ -240,7 +240,7 @@ BOOLEAN Swapped, AnotherPassNeeded;
if (AnotherPassNeeded)
{ for (J = StartAt; NOT Swapped AND (J <= Size); J++)
{ if (Matrix->Diag[J] == NULL)
{ Twins = CountTwins( Matrix, J, &pTwin1, &pTwin2 );
{ Twins = CountTwins( Matrix, J, &pTwin1, &pTwin2 ); /* FIXME: Twins is never used */
SwapCols( Matrix, pTwin1, pTwin2 );
Swapped = YES;
}