mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-21 18:21:27 +02:00
Eliminate @param_stack
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
195c0cdaca
commit
ecb71f7791
@ -50,7 +50,6 @@ our $VERSION = '4.4_15';
|
|||||||
|
|
||||||
our $macro_nest_level;
|
our $macro_nest_level;
|
||||||
our $current_param;
|
our $current_param;
|
||||||
our @param_stack;
|
|
||||||
our $family;
|
our $family;
|
||||||
#
|
#
|
||||||
# When splitting a line in the rules file, don't pad out the columns with '-' if the first column contains one of these
|
# When splitting a line in the rules file, don't pad out the columns with '-' if the first column contains one of these
|
||||||
@ -73,7 +72,6 @@ sub initialize( $ ) {
|
|||||||
$family = shift;
|
$family = shift;
|
||||||
$macro_nest_level = 0;
|
$macro_nest_level = 0;
|
||||||
$current_param = '';
|
$current_param = '';
|
||||||
@param_stack = ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
use constant { MAX_MACRO_NEST_LEVEL => 5 };
|
use constant { MAX_MACRO_NEST_LEVEL => 5 };
|
||||||
@ -1033,8 +1031,10 @@ sub process_rule1 ( $$$$$$$$$$$$$$ ) {
|
|||||||
#
|
#
|
||||||
fatal_error "Macro invocations nested too deeply" if ++$macro_nest_level > MAX_MACRO_NEST_LEVEL;
|
fatal_error "Macro invocations nested too deeply" if ++$macro_nest_level > MAX_MACRO_NEST_LEVEL;
|
||||||
|
|
||||||
|
my $save_param;
|
||||||
|
|
||||||
if ( $param ne '' ) {
|
if ( $param ne '' ) {
|
||||||
push @param_stack, $current_param;
|
$save_param = $current_param;
|
||||||
$current_param = $param unless $param eq 'PARAM';
|
$current_param = $param unless $param eq 'PARAM';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1057,7 +1057,7 @@ sub process_rule1 ( $$$$$$$$$$$$$$ ) {
|
|||||||
|
|
||||||
$macro_nest_level--;
|
$macro_nest_level--;
|
||||||
|
|
||||||
$current_param = pop @param_stack if $param ne '';
|
$current_param = $save_param if $param ne '';
|
||||||
|
|
||||||
return $generated;
|
return $generated;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user