From: Rico Tzschichholz Date: Wed, 27 Nov 2019 10:42:55 +0000 (+0100) Subject: vala: Don't ignore inner errors in Block and acknowledge them further X-Git-Tag: 0.47.2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=787a1e363e1f41e4c745cbc0ed4758c1c34fc2e8;p=thirdparty%2Fvala.git vala: Don't ignore inner errors in Block and acknowledge them further This avoids useless subsequent errors and possible criticals while operating on broken AST. --- diff --git a/vala/valablock.vala b/vala/valablock.vala index c4e8ab74e..a702ea011 100644 --- a/vala/valablock.vala +++ b/vala/valablock.vala @@ -159,7 +159,9 @@ public class Vala.Block : Symbol, Statement { context.analyzer.insert_block = this; for (int i = 0; i < statement_list.size; i++) { - statement_list[i].check (context); + if (!statement_list[i].check (context)) { + error = true; + } } foreach (LocalVariable local in get_local_variables ()) { diff --git a/vala/valacreationmethod.vala b/vala/valacreationmethod.vala index 5969fd398..3c0b22992 100644 --- a/vala/valacreationmethod.vala +++ b/vala/valacreationmethod.vala @@ -179,7 +179,7 @@ public class Vala.CreationMethod : Method { } // check that all errors that can be thrown in the method body are declared - if (body != null) { + if (body != null && !body.error) { var body_errors = new ArrayList (); body.get_error_types (body_errors); foreach (DataType body_error_type in body_errors) { diff --git a/vala/valamethod.vala b/vala/valamethod.vala index a105a0d0f..1be97ab21 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -954,7 +954,7 @@ public class Vala.Method : Subroutine, Callable { } // check that all errors that can be thrown in the method body are declared - if (body != null) { + if (body != null && !body.error) { var body_errors = new ArrayList (); body.get_error_types (body_errors); foreach (DataType body_error_type in body_errors) {