[vala/0.36] codegen: Initialize internal temp-variables used as reference parameter
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.36] codegen: Initialize internal temp-variables used as reference parameter
- Date: Mon, 5 Nov 2018 08:26:54 +0000 (UTC)
commit 7cd8ecb1994fe09d6e05ce047734a956033da30a
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Fri Nov 2 00:03:45 2018 +0100
codegen: Initialize internal temp-variables used as reference parameter
When casting Variant to multi-dimensional arrays the length fields are
used as out-parameters and needs to be initialized. They are not guaranteed
to be all set in _variant_get*() in this case.
Fixes tests with -Werror=maybe-uninitialized
codegen/valaccodebasemodule.vala | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index f0d064557..4aeee33f6 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5119,7 +5119,8 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
var ccall = new CCodeFunctionCall (new CCodeIdentifier (variant_func));
ccall.add_argument (get_cvalue_ (variant));
- var result = create_temp_value (to, false, node);
+ var needs_init = (to is ArrayType);
+ var result = create_temp_value (to, needs_init, node);
var cfunc = new CCodeFunction (variant_func);
cfunc.modifiers = CCodeModifiers.STATIC;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]