- bug fix in elaboration for big bit vectors (> 2048 bits)

This commit is contained in:
Ludovic Jacomme 2004-04-29 18:01:28 +00:00
parent 92631ba061
commit 00eeafa601
1 changed files with 14 additions and 1 deletions

View File

@ -88,7 +88,8 @@ void VasyElaborateVpnFig( VpnFigure )
vexexpr *DeclInit;
vasysimul *SimulInit;
char *SimulValue;
char Buffer[ 2048 ];
char *Buffer;
int MaxLength;
int LiteralId;
short Width;
short Position;
@ -100,6 +101,8 @@ void VasyElaborateVpnFig( VpnFigure )
}
SimulInit = (vasysimul *)0;
Buffer = (char *)0;
MaxLength = 0;
/*
** For all declarations set initial value
*/
@ -170,6 +173,14 @@ void VasyElaborateVpnFig( VpnFigure )
DeclAtom = VpnDeclar->VEX_ATOM;
Width = DeclAtom->WIDTH;
if ( MaxLength < ( Width + 4 ) )
{
if ( Buffer != (char *)0 ) autfreeblock( Buffer );
MaxLength = Width + 4;
Buffer = autallocblock( sizeof( char ) * MaxLength );
}
for ( Position = 0; Position < Width; Position++ )
{
VpnSymbol = &VpnDeclar->DECL_SYM[ Position ];
@ -201,6 +212,8 @@ void VasyElaborateVpnFig( VpnFigure )
}
}
if ( Buffer != (char *)0 ) autfreeblock( Buffer );
if ( IsVasyDebugLevel0() )
{
VasyPrintf( stdout, "<-- VasyElaborateVpnFig %s\n", VpnFigure->NAME );