summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorAurelien Aptel <aaptel@suse.com>2016-02-05 14:43:04 +0100
committerStefan Metzmacher <metze@samba.org>2016-06-20 12:08:20 +0200
commit30e7be511e85919bc71f8e653b0b089c76c6f31f (patch)
tree76c65f32896ac43a5bdf79007c05088f4bfbbec7 /pidl
parent54898557d83bd7db78086b270e109b67d9ea6455 (diff)
downloadsamba-30e7be511e85919bc71f8e653b0b089c76c6f31f.tar.gz
pidl/ws: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Port Wireshark commit f6b9e7a Author: Alexis La Goutte <alexis.lagoutte@gmail.com> Date: Sun Sep 28 20:57:13 2014 +0200 PIDL: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang Change-Id: Ibae478771b30d6e9ae07315985f1e71bc6b65423 Reviewed-on: https://code.wireshark.org/review/4350 Reviewed-by: Michael Mann <mmann78@netscape.net> Signed-off-by: Aurelien Aptel <aaptel@suse.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Wireshark/NDR.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
index 698f8c61a5e..40c59c9a517 100644
--- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
+++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
@@ -690,7 +690,9 @@ sub Struct($$$$)
$self->indent;
$self->pidl_code($_) foreach (@$vars);
$self->pidl_code("proto_item *item = NULL;");
- $self->pidl_code("proto_tree *tree = NULL;");
+ if($res) {
+ $self->pidl_code("proto_tree *tree = NULL;");
+ }
if (defined($doalign)) {
$self->pidl_code("dcerpc_info *di = (dcerpc_info *)pinfo->private_data;");
if ($doalign == 0) {
@@ -715,7 +717,9 @@ sub Struct($$$$)
$self->pidl_code("if (parent_tree) {");
$self->indent;
$self->pidl_code("item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);");
- $self->pidl_code("tree = proto_item_add_subtree(item, ett_$ifname\_$name);");
+ if($res) {
+ $self->pidl_code("tree = proto_item_add_subtree(item, ett_$ifname\_$name);");
+ }
$self->deindent;
$self->pidl_code("}");