summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-06-06 12:04:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:43 -0500
commit8e05f12bc4a12b16cd7afa6b65c3379814216159 (patch)
tree690781107a128de96379f0e371f18fe0f73d2ef3 /source4/build/pidl
parentd8889b6f8d2ce0c5551a0be0dbb24ae5a3abf53f (diff)
downloadsamba-8e05f12bc4a12b16cd7afa6b65c3379814216159.tar.gz
samba-8e05f12bc4a12b16cd7afa6b65c3379814216159.tar.bz2
samba-8e05f12bc4a12b16cd7afa6b65c3379814216159.zip
r7330: use ParseExpr() also for subcontext_size()
metze (This used to be commit 2db46afef719de99953e5a31036424454f6c7e43)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r--source4/build/pidl/ndr_parser.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/source4/build/pidl/ndr_parser.pm b/source4/build/pidl/ndr_parser.pm
index 473aa94f13..0dd1289d80 100644
--- a/source4/build/pidl/ndr_parser.pm
+++ b/source4/build/pidl/ndr_parser.pm
@@ -522,12 +522,14 @@ sub ParseSubcontextPushStart($$$$$)
return $retndr;
}
-sub ParseSubcontextPushEnd($$$)
+sub ParseSubcontextPushEnd($$$$)
{
my $e = shift;
my $l = shift;
my $ndr_flags = shift;
+ my $env = shift;
my $ndr = "_ndr_$e->{NAME}";
+ my $subcontext_size = ParseExpr($l->{SUBCONTEXT_SIZE},$env);
if (defined $l->{COMPRESSION}) {
ParseCompressionPushEnd($e, $l, $ndr);
@@ -537,7 +539,7 @@ sub ParseSubcontextPushEnd($$$)
ParseObfuscationPushEnd($e, $ndr);
}
- pidl "NDR_CHECK(ndr_push_subcontext_header(ndr, $l->{HEADER_SIZE}, $l->{SUBCONTEXT_SIZE}, $ndr));";
+ pidl "NDR_CHECK(ndr_push_subcontext_header(ndr, $l->{HEADER_SIZE}, $subcontext_size, $ndr));";
pidl "NDR_CHECK(ndr_push_bytes(ndr, $ndr->data, $ndr->offset));";
deindent;
pidl "}";
@@ -552,12 +554,13 @@ sub ParseSubcontextPullStart($$$$$$)
my $ndr_flags = shift;
my $env = shift;
my $retndr = "_ndr_$e->{NAME}";
+ my $subcontext_size = ParseExpr($l->{SUBCONTEXT_SIZE},$env);
pidl "{";
indent;
pidl "struct ndr_pull *$retndr;";
pidl "NDR_ALLOC(ndr, $retndr);";
- pidl "NDR_CHECK(ndr_pull_subcontext_header($ndr, $l->{HEADER_SIZE}, $l->{SUBCONTEXT_SIZE}, $retndr));";
+ pidl "NDR_CHECK(ndr_pull_subcontext_header($ndr, $l->{HEADER_SIZE}, $subcontext_size, $retndr));";
if (defined $l->{COMPRESSION}) {
$retndr = ParseCompressionPullStart($e, $l, $retndr, $env);
@@ -570,10 +573,11 @@ sub ParseSubcontextPullStart($$$$$$)
return ($retndr,$var_name);
}
-sub ParseSubcontextPullEnd($$)
+sub ParseSubcontextPullEnd($$$)
{
my $e = shift;
my $l = shift;
+ my $env = shift;
my $ndr = "_ndr_$e->{NAME}";
if (defined $l->{COMPRESSION}) {
@@ -586,7 +590,7 @@ sub ParseSubcontextPullEnd($$)
my $advance;
if (defined($l->{SUBCONTEXT_SIZE}) and ($l->{SUBCONTEXT_SIZE} ne "-1")) {
- $advance = $l->{SUBCONTEXT_SIZE};
+ $advance = ParseExpr($l->{SUBCONTEXT_SIZE},$env);
} elsif ($l->{HEADER_SIZE}) {
$advance = "$ndr->data_size";
} else {
@@ -613,7 +617,7 @@ sub ParseElementPushLevel
if ($l->{TYPE} eq "SUBCONTEXT") {
$ndr = ParseSubcontextPushStart($e, $l, $ndr, $var_name, $ndr_flags);
ParseElementPushLevel($e, Ndr::GetNextLevel($e, $l), $ndr, $var_name, $env, 1, 1);
- ParseSubcontextPushEnd($e, $l, $ndr_flags);
+ ParseSubcontextPushEnd($e, $l, $ndr_flags, $env);
} elsif ($l->{TYPE} eq "POINTER") {
ParsePtrPush($e, $l, $var_name);
} elsif ($l->{TYPE} eq "ARRAY") {
@@ -934,7 +938,7 @@ sub ParseElementPullLevel
if ($l->{TYPE} eq "SUBCONTEXT") {
($ndr,$var_name) = ParseSubcontextPullStart($e, $l, $ndr, $var_name, $ndr_flags, $env);
ParseElementPullLevel($e,Ndr::GetNextLevel($e,$l), $ndr, $var_name, $env, 1, 1);
- ParseSubcontextPullEnd($e, $l);
+ ParseSubcontextPullEnd($e, $l, $env);
} elsif ($l->{TYPE} eq "ARRAY") {
my $length = ParseArrayPullHeader($e, $l, $ndr, $var_name, $env);