summaryrefslogtreecommitdiffstats
path: root/src/map/mio
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-02-06 12:07:42 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2016-02-06 12:07:42 -0800
commit355865e81b56791b8189f1c369f804d16b0ef814 (patch)
tree6fb585afeeb401b52fe6f273690b76e990610c4f /src/map/mio
parent76670892c2651c43d1d75a11f6b2eb2a46ba6a01 (diff)
downloadabc-355865e81b56791b8189f1c369f804d16b0ef814.tar.gz
abc-355865e81b56791b8189f1c369f804d16b0ef814.tar.bz2
abc-355865e81b56791b8189f1c369f804d16b0ef814.zip
GENLIB parsing bug, which led to a crash.
Diffstat (limited to 'src/map/mio')
-rw-r--r--src/map/mio/mioRead.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/mio/mioRead.c b/src/map/mio/mioRead.c
index f9a16b18..ab2d0761 100644
--- a/src/map/mio/mioRead.c
+++ b/src/map/mio/mioRead.c
@@ -55,6 +55,7 @@ Mio_Library_t * Mio_LibraryRead( char * FileName, char * pBuffer, char * Exclude
{
Mio_Library_t * pLib;
int num;
+ char * pBufferCopy;
st__table * tExcludeGate = 0;
@@ -70,6 +71,7 @@ Mio_Library_t * Mio_LibraryRead( char * FileName, char * pBuffer, char * Exclude
fprintf ( stdout, "Read %d gates from exclude file\n", num );
}
+ pBufferCopy = Abc_UtilStrsav(pBuffer);
if ( pBuffer == NULL )
pLib = Mio_LibraryReadOne( FileName, 0, tExcludeGate, fVerbose ); // try normal format first ..
else
@@ -84,13 +86,14 @@ Mio_Library_t * Mio_LibraryRead( char * FileName, char * pBuffer, char * Exclude
pLib = Mio_LibraryReadOne( FileName, 1, tExcludeGate, fVerbose ); // try normal format first ..
else
{
- pLib = Mio_LibraryReadBuffer( pBuffer, 1, tExcludeGate, fVerbose ); // try normal format first ..
+ pLib = Mio_LibraryReadBuffer( pBufferCopy, 1, tExcludeGate, fVerbose ); // try normal format first ..
if ( pLib )
pLib->pName = Abc_UtilStrsav( Extra_FileNameGenericAppend(FileName, ".genlib") );
}
if ( pLib != NULL )
printf ( "Warning: Read extended genlib format but ignoring extensions\n" );
}
+ ABC_FREE( pBufferCopy );
if ( tExcludeGate )
st__free_table( tExcludeGate );