diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-12-04 12:45:42 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-12-12 03:56:23 +0000 |
commit | 82aff583b7f7e018ad4a1db92dc635df8e5ebe7b (patch) | |
tree | 8887ee21009447280060344b797830f8ca78f28d /pidl/lib | |
parent | d30c377d8c4e8a83b2722b771aa72d219eb69b46 (diff) | |
download | samba-82aff583b7f7e018ad4a1db92dc635df8e5ebe7b.tar.gz |
libndr: Return enum ndr_err_code from ndr_{pull,push}_steal_switch_value()
This breaks the ABI so we merge this into the unreleased libndr-1.0.0.
The advantage of the new functions is there (except for print, which
is unchanged) is an error raised when the token is not found, so
we can be confident in the changes to the token behaviour.
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>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Dec 12 03:56:23 UTC 2019 on sn-devel-184
Diffstat (limited to 'pidl/lib')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 31dce4bc2ba..0d58cb5f03d 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -1983,7 +1983,7 @@ sub ParseUnionPush($$$$) $self->pidl("if (ndr_flags & NDR_SCALARS) {"); $self->indent; $self->pidl("/* This token is not used again (except perhaps below in the NDR_BUFFERS case) */"); - $self->pidl("level = ndr_push_steal_switch_value($ndr, $varname);"); + $self->pidl("NDR_CHECK(ndr_push_steal_switch_value($ndr, $varname, &level));"); $self->ParseUnionPushPrimitives($e, $ndr, $varname); $self->deindent; @@ -1995,7 +1995,7 @@ sub ParseUnionPush($$$$) $self->pidl("if (!(ndr_flags & NDR_SCALARS)) {"); $self->indent; $self->pidl("/* We didn't get it above, and the token is not needed after this. */"); - $self->pidl("level = ndr_push_steal_switch_value($ndr, $varname);"); + $self->pidl("NDR_CHECK(ndr_push_steal_switch_value($ndr, $varname, &level));"); $self->deindent; $self->pidl("}"); $self->ParseUnionPushDeferred($e, $ndr, $varname); @@ -2171,7 +2171,7 @@ sub ParseUnionPull($$$$) $self->pidl("if (ndr_flags & NDR_SCALARS) {"); $self->indent; $self->pidl("/* This token is not used again (except perhaps below in the NDR_BUFFERS case) */"); - $self->pidl("level = ndr_pull_steal_switch_value($ndr, $varname);"); + $self->pidl("NDR_CHECK(ndr_pull_steal_switch_value($ndr, $varname, &level));"); $self->ParseUnionPullPrimitives($e,$ndr,$varname,$switch_type); $self->deindent; $self->pidl("}"); @@ -2182,7 +2182,7 @@ sub ParseUnionPull($$$$) $self->pidl("if (!(ndr_flags & NDR_SCALARS)) {"); $self->indent; $self->pidl("/* We didn't get it above, and the token is not needed after this. */"); - $self->pidl("level = ndr_pull_steal_switch_value($ndr, $varname);"); + $self->pidl("NDR_CHECK(ndr_pull_steal_switch_value($ndr, $varname, &level));"); $self->deindent; $self->pidl("}"); $self->ParseUnionPullDeferred($e,$ndr,$varname); |