From: David Howells Date: Wed, 9 Apr 2014 20:27:58 +0000 (+0100) Subject: rxgen: Set struct members correctly in struct types X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0c67e7fd6bcba7df76565f75cd46164e30a0d6cb;p=users%2Fdhowells%2Fkafs-utils.git rxgen: Set struct members correctly in struct types 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 --- diff --git a/rxgen/emit_py_types.pm b/rxgen/emit_py_types.pm index 3a6e0cf..6da15c4 100644 --- a/rxgen/emit_py_types.pm +++ b/rxgen/emit_py_types.pm @@ -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") {