Commit 8c0a4de2 authored by Ronny Wichers Schreur's avatar Ronny Wichers Schreur

bug fix in initialisation

parent df973c64
......@@ -3411,10 +3411,18 @@ BEStrictPositions (int functionIndex, int *bits, int **positions)
strict_positions = ruleType->type_alt_strict_positions;
Assert (strict_positions != NULL);
*bits = strict_positions->sp_size;
*positions = strict_positions->sp_bits;
if (strict_positions == NULL)
{
/* this can happen if sa is turned of, or if the sa has failed
(for example when it's out of memory) */
*bits = 0;
*positions = NULL;
}
else
{
*bits = strict_positions->sp_size;
*positions = strict_positions->sp_bits;
}
} /* BEStrictPositions */
int
......
......@@ -2910,10 +2910,11 @@ static void StrictPositionsClear (void)
{
int sizeBytes;
sizeInts = bits2ints(kMaxStrictPositions);
sizeInts = bits2ints(kMaxStrictBits);
sizeBytes = sizeof (StrictPositionsS) + (sizeInts-1) * sizeof (int);
strict_positions = CompAlloc (sizeBytes);
for (i = 0; i < sizeInts; i++)
strict_positions->sp_bits[i] = 0;
strict_positions->sp_size = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment