]> 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>
Tue, 1 Aug 2023 20:16:40 +0000 (22:16 +0200)
Old token buffer entries will result in faulty source references.

vala/valagenieparser.vala
vala/valaparser.vala

index a1336ae4b586afa1fa6769ec04ddb137d1d68908..4134b21c8ac6d2086a17404fa910a44878b24e1c 100644 (file)
@@ -416,6 +416,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 85f7fbcde9a4620d4778994c3baba26612eb7f39..33cb4843ee2dfab378c2f66444a84bf97032095f 100644 (file)
@@ -406,6 +406,7 @@ public class Vala.Parser : CodeVisitor {
                scanner = new Scanner (source_file);
                parse_file_comments ();
 
+               tokens = new TokenInfo[BUFFER_SIZE];
                index = -1;
                size = 0;