ide-vala-index.vala is broken because of recent vala parser update
Submitted by ryu..@..il.com
Link to original bug (#791936)
Description
This is the related vala update.
commit 2dc47785171f8f62f7f017939681e0d5cf3e9847 Author: Rico Tzschichholz ricotz@ubuntu.com Date: Thu Dec 14 10:23:14 2017 +0100
Release taken references to CodeContext after using it
https://bugzilla.gnome.org/show_bug.cgi?id=712694
vala/valaparser.vala | 1 + 1 file changed, 1 insertion(+)
diff --git a/vala/valaparser.vala b/vala/valaparser.vala index ec5e34e82..6228ba98e 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -76,6 +76,7 @@ public class Vala.Parser : CodeVisitor { public void parse (CodeContext context) { this.context = context; context.accept (this);
-
this.context = null; } public override void visit_source_file (SourceFile source_file) {
We have these lines in ide-vala-index.vala
public ValaIndex (Ide.Context context)
{
...
this.parser = new Vala.Parser ();
this.parser.parse (this.code_context);
...
}
void reparse ()
{
this.report.clear ();
foreach (var source_file in this.code_context.get_source_files ()) {
if (source_file.get_nodes ().size == 0) {
this.parser.visit_source_file (source_file);
if (source_file is Ide.ValaSourceFile) {
(source_file as Ide.ValaSourceFile).dirty = false;
}
}
}
}
Vala.Parser.visit_source_files() tries to use Vala.CodeContext internally but it is set as null already. It shows messages like this and indexing job seems to fail.
10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_run_output: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_parser_parse_using_directives: assertion 'ns != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_parser_parse_declarations: assertion 'parent != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_run_output: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_parser_parse_using_directives: assertion 'ns != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed 10:16:45.0013 (null)[ 17591]: CRITICAL: vala_parser_parse_declarations: assertion 'parent != NULL' failed