diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-11-15 20:04:41 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-12-12 02:30:40 +0000 |
commit | 5eb560d25e9104dc02477a6bf819d0c37e8afb86 (patch) | |
tree | 763f0ddb0019d5cab8b431c1b297f11354e47c4d /pidl/lib | |
parent | e08461b2845183224b9775b54be4acaaba705ecd (diff) | |
download | samba-5eb560d25e9104dc02477a6bf819d0c37e8afb86.tar.gz |
pidl: Mismatch between set and get of relative base pointers
The set was within the switch, the get was before the switch.
The difference is shown when there is an empty default element.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13876
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'pidl/lib')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index d51063f7216..31dce4bc2ba 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -2109,11 +2109,6 @@ sub ParseUnionPullDeferred($$$$) my ($self,$e,$ndr,$varname) = @_; my $have_default = 0; - if (defined($e->{PROPERTIES}{relative_base})) { - # retrieve the current offset as base for relative pointers - # based on the toplevel struct/union - $self->pidl("NDR_CHECK(ndr_pull_setup_relative_base_offset2($ndr, $varname));"); - } $self->pidl("switch (level) {"); $self->indent; foreach my $el (@{$e->{ELEMENTS}}) { @@ -2124,6 +2119,11 @@ sub ParseUnionPullDeferred($$$$) $self->pidl("$el->{CASE}:"); if ($el->{TYPE} ne "EMPTY") { $self->indent; + if (defined($e->{PROPERTIES}{relative_base})) { + # retrieve the current offset as base for relative pointers + # based on the toplevel struct/union + $self->pidl("NDR_CHECK(ndr_pull_setup_relative_base_offset2($ndr, $varname));"); + } $self->ParseElementPull($el, $ndr, {$el->{NAME} => "$varname->$el->{NAME}"}, 0, 1); $self->deindent; } |