]> www.infradead.org Git - users/dhowells/kafs-utils.git/commitdiff
rxgen: Set struct members correctly in struct types
authorDavid Howells <dhowells@redhat.com>
Wed, 9 Apr 2014 20:27:58 +0000 (21:27 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 9 Apr 2014 20:27:58 +0000 (21:27 +0100)
When setting a member of a struct (eg. VL.ListAddrByAttributes) where that
member is itself a struct type (eg. afsUUID), we need to check that the type
of the value to assign is the member type, not the container type.

Signed-off-by: David Howells <dhowells@redhat.com>
rxgen/emit_py_types.pm

index 3a6e0cff9cfb64886026c0d833b50adbd2c1c748..6da15c4f48fb470c25d6c62f9924f12f8e6626d8 100644 (file)
@@ -190,7 +190,7 @@ sub emit_py_type_wrapper($) {
            print PYOUT "\t\tif (PyUnicode_CompareWithASCIIString(name, \"", $m->{name}, "\") == 0)\n";
            if ($m->{class} eq "struct") {
                print PYOUT "\t\t\treturn py_rxgen_set_struct(&self->c.", $m->{name}, ",\n";
-               print PYOUT "\t\t\t\t\t\t   &py_", $struct->{type}, "Type, val);\n";
+               print PYOUT "\t\t\t\t\t\t   &py_", $m->{type}, "Type, val);\n";
            } elsif ($m->{class} ne "array") {
                die $m->{where}, ": Unsupported type class \"", $m->{class}, "\"";
            } elsif ($m->{elem}->{type} eq "char") {