From ad65ff56002adc50c5fff13fbf0398f071bbcfd8 Mon Sep 17 00:00:00 2001
From: svenbarth <pascaldragon@googlemail.com>
Date: Fri, 30 Jun 2017 15:59:33 +0000
Subject: [PATCH] * insert symbol only once

git-svn-id: trunk@36620 -
---
 compiler/pdecvar.pas | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/pdecvar.pas b/compiler/pdecvar.pas
index 71bd00620f..037fd1a7c3 100644
--- a/compiler/pdecvar.pas
+++ b/compiler/pdecvar.pas
@@ -1345,7 +1345,6 @@ implementation
                else
                  begin
                    vs.register_sym;
-                   symtablestack.top.insert(vs);
                    if isgeneric then
                      begin
                        { ensure correct error position }
@@ -1353,7 +1352,9 @@ implementation
                        current_filepos:=tmp_filepos;
                        symtablestack.top.insert(vs);
                        current_filepos:=old_current_filepos;
-                     end;
+                     end
+                   else
+                     symtablestack.top.insert(vs);
                  end;
              until not try_to_consume(_COMMA);