From 3114289c6434165a23996cb481dea619ee62d55f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 24 Nov 2003 03:31:03 +0000 Subject: make sure we don't try to update a constant (This used to be commit 4a6034f2e37d1050364fc167f1b71b5c806dfdc9) --- source4/build/pidl/parser.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source4/build') diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm index 788660c198..e536ab083d 100644 --- a/source4/build/pidl/parser.pm +++ b/source4/build/pidl/parser.pm @@ -295,7 +295,10 @@ sub ParseArrayPull($$$) pidl "\t\tif ($size != _array_size) {\n"; } pidl "\t\t\treturn ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, \"Bad array size %u should be %u\", _array_size, $size);\n"; - pidl "\t\t} else { $size = _array_size; }\n"; + pidl "\t\t}\n"; + if ($size =~ /r->/) { + pidl "else { $size = _array_size; }\n"; + } pidl "\t}\n"; } @@ -425,7 +428,10 @@ sub ParseElementPullSwitch($$$$) } else { pidl "\t\tif (_level != $switch_var) {\n"; } - pidl "\t\t\treturn ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, \"Bad switch value %u in $e->{NAME}\");\t\t} else { $switch_var = _level; }\n"; + pidl "\t\t\treturn ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, \"Bad switch value %u in $e->{NAME}\");\t\t}\n"; + if ($switch =~ /r->/) { + pidl "else { $switch_var = _level; }\n"; + } pidl "\t}\n"; } -- cgit