From 0c67e7fd6bcba7df76565f75cd46164e30a0d6cb Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 9 Apr 2014 21:27:58 +0100 Subject: [PATCH] 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 --- rxgen/emit_py_types.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") { -- 2.49.0