mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
checkpatch: handle missing #if open in context
If the #if opening statement is not in the context then the context stack can be empty. Handle this by ensuring there is always a blank entry in the stack. Signed-off-by: Andy Whitcroft <apw@canonical.com> Tested-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c91192d66d
commit
a27506459c
1 changed files with 3 additions and 1 deletions
|
@ -411,13 +411,15 @@ sub ctx_statement_block {
|
|||
|
||||
my $type = '';
|
||||
my $level = 0;
|
||||
my @stack = ([$type, $level]);
|
||||
my @stack = ();
|
||||
my $p;
|
||||
my $c;
|
||||
my $len = 0;
|
||||
|
||||
my $remainder;
|
||||
while (1) {
|
||||
@stack = (['', 0]) if ($#stack == -1);
|
||||
|
||||
#warn "CSB: blk<$blk> remain<$remain>\n";
|
||||
# If we are about to drop off the end, pull in more
|
||||
# context.
|
||||
|
|
Loading…
Reference in a new issue