Skip to content

Commit

Permalink
pidl: added checking of NDR flags in generated code
Browse files Browse the repository at this point in the history
Pair-Programmed-With: Andrew Bartlett <[email protected]>
  • Loading branch information
Andrew Tridgell committed Sep 8, 2011
1 parent a19fd96 commit 3d5dd91
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,7 @@ sub ParseStructPush($$$$)

$self->start_flags($struct, $ndr);

$self->pidl("NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);");
$self->pidl("if (ndr_flags & NDR_SCALARS) {");
$self->indent;
$self->ParseStructPushPrimitives($struct, $ndr, $varname, $env);
Expand Down Expand Up @@ -1645,6 +1646,7 @@ sub ParseStructPull($$$$)

my $env = GenerateStructEnv($struct, $varname);

$self->pidl("NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);");
$self->pidl("if (ndr_flags & NDR_SCALARS) {");
$self->indent;
$self->ParseStructPullPrimitives($struct,$ndr,$varname,$env);
Expand Down Expand Up @@ -1808,6 +1810,7 @@ sub ParseUnionPush($$$$)

$self->start_flags($e, $ndr);

$self->pidl("NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);");
$self->pidl("if (ndr_flags & NDR_SCALARS) {");
$self->indent;
$self->ParseUnionPushPrimitives($e, $ndr, $varname);
Expand Down Expand Up @@ -1985,6 +1988,7 @@ sub ParseUnionPull($$$$)

$self->pidl("level = ndr_pull_get_switch_value($ndr, $varname);");

$self->pidl("NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);");
$self->pidl("if (ndr_flags & NDR_SCALARS) {");
$self->indent;
$self->ParseUnionPullPrimitives($e,$ndr,$varname,$switch_type);
Expand Down Expand Up @@ -2267,6 +2271,8 @@ sub ParseFunctionPush($$)
$self->DeclareArrayVariables($e);
}

$self->pidl("NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);");

$self->pidl("if (flags & NDR_IN) {");
$self->indent;

Expand Down Expand Up @@ -2354,6 +2360,8 @@ sub ParseFunctionPull($$)
$double_cases{"$e->{NAME}"} = 1;
}

$self->pidl("NDR_PULL_CHECK_FN_FLAGS(ndr, flags);");

$self->pidl("if (flags & NDR_IN) {");
$self->indent;

Expand Down

0 comments on commit 3d5dd91

Please sign in to comment.