summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Util.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-01-09 23:41:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:37:19 -0500
commit95f7f4d001684d447ce8e0f880200cfac89f011a (patch)
treeaf93da8a5924c4d0ab5b882cfbed24e6ea5a8052 /source4/pidl/lib/Parse/Pidl/Util.pm
parenta338d29bc1e7d902190cc5ddb370eebc2ea4929d (diff)
downloadsamba-95f7f4d001684d447ce8e0f880200cfac89f011a.tar.gz
samba-95f7f4d001684d447ce8e0f880200cfac89f011a.tar.bz2
samba-95f7f4d001684d447ce8e0f880200cfac89f011a.zip
r20637: Don't check for NULL pointers when the pointer is guaranteed to not be NULL
(if it is a ref pointer). (This used to be commit 419547df76c38fde1f54b06dc633832523ad3394)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Util.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Util.pm19
1 files changed, 18 insertions, 1 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Util.pm b/source4/pidl/lib/Parse/Pidl/Util.pm
index 35338492dd..35e25286f5 100644
--- a/source4/pidl/lib/Parse/Pidl/Util.pm
+++ b/source4/pidl/lib/Parse/Pidl/Util.pm
@@ -6,7 +6,7 @@ package Parse::Pidl::Util;
require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(has_property property_matches ParseExpr is_constant make_str print_uuid MyDumper);
+@EXPORT = qw(has_property property_matches ParseExpr ParseExprExt is_constant make_str print_uuid MyDumper);
use vars qw($VERSION);
$VERSION = '0.01';
@@ -115,4 +115,21 @@ sub ParseExpr($$$)
undef);
}
+sub ParseExprExt($$$$)
+{
+ my($expr, $varlist, $e, $deref) = @_;
+
+ die("Undefined value in ParseExpr") if not defined($expr);
+
+ my $x = new Parse::Pidl::Expr();
+
+ return $x->Run($expr, sub { my $x = shift; error($e, $x); },
+ # Lookup fn
+ sub { my $x = shift;
+ return($varlist->{$x}) if (defined($varlist->{$x}));
+ return $x;
+ },
+ $deref);
+}
+
1;