[master] fb5779c vmodtool: enforce unique argument names
Nils Goroll
nils.goroll at uplex.de
Thu Dec 21 17:17:06 UTC 2017
commit fb5779c6e2c765dea4b54019330cf6741a80bd41
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Thu Dec 21 18:13:55 2017 +0100
vmodtool: enforce unique argument names
diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index 851f032..f870e69 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -337,8 +337,13 @@ class prototype(object):
assert s[-1] == ")"
s = s[1:-1].lstrip()
self.args = []
+ names = {}
while len(s) > 0:
a, s = arg(s)
+ if a.nm is not None and a.nm in names:
+ err("%s(): duplicate argument name '%s'\n" % (self.name, a.nm),
+ warn=False)
+ names[a.nm] = True
self.args.append(a)
s = s.lstrip()
if len(s) == 0:
More information about the varnish-commit
mailing list