diff options
author | Patrick McHardy <kaber@trash.net> | 2014-02-04 11:22:31 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2014-02-04 11:26:25 +0000 |
commit | 852cefe60391a16c5fa238f3ab3044dad239c508 (patch) | |
tree | 90b9939c14df1a6f4dde6d55506a5e75414bb1ee /tests/symbolic-define.3 | |
parent | 47e7132763633d88307ed5fadaf5f2b11d5490c6 (diff) |
parser: prohibit redefinitions of symbols and verify existance on use
This patch fixes some incorrect behaviour of symbolic variables:
- prohibit redefining an existing symbol
- verify existance of a symbolic variable during parsing instead of evaluation
The second point makes sure we don't allow recursive definitions (var = $var),
which lead to a crash due to stack exhaustion.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'tests/symbolic-define.3')
-rw-r--r-- | tests/symbolic-define.3 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/symbolic-define.3 b/tests/symbolic-define.3 new file mode 100644 index 00000000..ba224df7 --- /dev/null +++ b/tests/symbolic-define.3 @@ -0,0 +1,6 @@ +#! nft -f + +# error: recursive definition of a variable +define var1 = $var1 + +filter input iif $var1 |