diff options
Diffstat (limited to 'src/vhdlparser.y')
-rw-r--r-- | src/vhdlparser.y | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vhdlparser.y b/src/vhdlparser.y index d4223c0..cda97a4 100644 --- a/src/vhdlparser.y +++ b/src/vhdlparser.y @@ -2119,8 +2119,11 @@ static void addCompInst(char *n, char* instName, char* comp,int iLine) initEntry(current); instFiles.append(new Entry(*current)); } - delete current; - current=new Entry; + + Entry *temp=current; // hold current pointer (temp=oldEntry) + current=new Entry; // (oldEntry != current) + delete temp; + } else { |