[glib/glib-2-60: 1/2] codegen: Fix use of uninitialised variable



commit 2824503868262a832a100dabcaaea34d169974b9
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Mar 13 13:13:24 2019 +0000

    codegen: Fix use of uninitialised variable
    
    If using the --interface-info-{body,header} options to gdbus-codegen,
    and the first interface to be outputted has no methods, but does have
    properties or signals, an uninitialised variable would be used for the
    property/signal ‘since’ values.
    
    In other situations, the ‘since’ value for a prior method would have
    been incorrectly used for the properties/signals.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 gio/gdbus-2.0/codegen/codegen.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/gdbus-2.0/codegen/codegen.py b/gio/gdbus-2.0/codegen/codegen.py
index 8dabc1448..aa1280f59 100644
--- a/gio/gdbus-2.0/codegen/codegen.py
+++ b/gio/gdbus-2.0/codegen/codegen.py
@@ -826,7 +826,7 @@ class InterfaceInfoBodyCodeGenerator:
                     self.outfile.write('};\n')
                     self.outfile.write('\n')
 
-                    key = (m.since, '%s_interface__%s_signal' % (i.name_lower, s.name_lower))
+                    key = (s.since, '%s_interface__%s_signal' % (i.name_lower, s.name_lower))
                     signal_pointers.append(key)
 
                 self.generate_array('%s_interface_signals' % i.name_lower,
@@ -861,7 +861,7 @@ class InterfaceInfoBodyCodeGenerator:
                     self.outfile.write('};\n')
                     self.outfile.write('\n')
 
-                    key = (m.since, '%s_interface__%s_property' % (i.name_lower, p.name_lower))
+                    key = (p.since, '%s_interface__%s_property' % (i.name_lower, p.name_lower))
                     property_pointers.append(key)
 
                 self.generate_array('%s_interface_properties' % i.name_lower,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]