[vala/0.40] 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.40] codegen: Initialize internal temp-variables used as reference parameter
- Date: Mon, 5 Nov 2018 08:13:08 +0000 (UTC)
commit d107e1047c92e994e1928eef4d30d40e61f1d3c8
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 cae9538c9..95f2ddfbf 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5151,7 +5151,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]