summaryrefslogtreecommitdiff
path: root/codegen/valagerrormodule.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-05-17 08:56:12 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2019-05-17 09:08:37 +0200
commita929a44437a46eb9f814160c4ecf807a94ba2138 (patch)
tree666f9f8c240faba9dabc47253eceeb6b6ae8b031 /codegen/valagerrormodule.vala
parentef0973068d1786206bc98c4861f0ea9d2617edb5 (diff)
downloadvala-a929a44437a46eb9f814160c4ecf807a94ba2138.tar.gz
codegen: When freeing local variables don't stop at "switch" on "continue"
So distinguish between BreakStatement and ContinueStatement to make the correct decision in append_local_free(). Fixes https://gitlab.gnome.org/GNOME/vala/issues/799
Diffstat (limited to 'codegen/valagerrormodule.vala')
-rw-r--r--codegen/valagerrormodule.vala8
1 files changed, 4 insertions, 4 deletions
diff --git a/codegen/valagerrormodule.vala b/codegen/valagerrormodule.vala
index 6855377c8..bae957f02 100644
--- a/codegen/valagerrormodule.vala
+++ b/codegen/valagerrormodule.vala
@@ -102,7 +102,7 @@ public class Vala.GErrorModule : CCodeDelegateModule {
ccode.add_expression (cpropagate);
// free local variables
- append_local_free (current_symbol, false);
+ append_local_free (current_symbol);
if (current_method is CreationMethod && current_method.parent_symbol is Class) {
var cl = (Class) current_method.parent_symbol;
@@ -117,7 +117,7 @@ public class Vala.GErrorModule : CCodeDelegateModule {
void uncaught_error_statement (CCodeExpression inner_error, bool unexpected = false) {
// free local variables
- append_local_free (current_symbol, false);
+ append_local_free (current_symbol);
var ccritical = new CCodeFunctionCall (new CCodeIdentifier ("g_critical"));
ccritical.add_argument (new CCodeConstant (unexpected ? "\"file %s: line %d: unexpected error: %s (%s, %d)\"" : "\"file %s: line %d: uncaught error: %s (%s, %d)\""));
@@ -185,9 +185,9 @@ public class Vala.GErrorModule : CCodeDelegateModule {
// free local variables
if (is_in_catch) {
- append_local_free (current_symbol, false, current_catch);
+ append_local_free (current_symbol, null, current_catch);
} else {
- append_local_free (current_symbol, false, current_try);
+ append_local_free (current_symbol, null, current_try);
}
var error_types = new ArrayList<DataType> ();