]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
parser: Reset tokens buffer when parsing a new source file
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 1 Aug 2023 20:11:43 +0000 (22:11 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 2 Aug 2023 12:59:18 +0000 (14:59 +0200)
Old token buffer entries will result in faulty source references.

vala/valagenieparser.vala
vala/valaparser.vala

index 5c431006ea7a93898ea345412149be30d59b0741..a95aeddb645d687756112ab2ae3fd35032bed7cc 100644 (file)
@@ -411,6 +411,8 @@ public class Vala.Genie.Parser : CodeVisitor {
                scanner = new Scanner (source_file);
                scanner.parse_file_comments ();
                scanner.indent_spaces = 0;
+
+               tokens = new TokenInfo[BUFFER_SIZE];
                index = -1;
                size = 0;
 
index 8f56960bd2b10b987823a1385ca18216753b98b9..78770387f20664b8654da667a70e2e1a5c928c05 100644 (file)
@@ -401,6 +401,7 @@ public class Vala.Parser : CodeVisitor {
                scanner = new Scanner (source_file);
                parse_file_comments ();
 
+               tokens = new TokenInfo[BUFFER_SIZE];
                index = -1;
                size = 0;