Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 oops I terminated the block too early (t...



details:   https://anonhg.NetBSD.org/src/rev/7a737c8eb20d
branches:  trunk
changeset: 332526:7a737c8eb20d
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Sep 26 15:26:01 2014 +0000

description:
oops I terminated the block too early (thanks unit tests!)

diffstat:

 usr.bin/xlint/lint1/cgram.y |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (49 lines):

diff -r def0dfd2bda4 -r 7a737c8eb20d usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Fri Sep 26 13:48:00 2014 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Fri Sep 26 15:26:01 2014 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.66 2014/09/26 01:20:00 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.67 2014/09/26 15:26:01 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.66 2014/09/26 01:20:00 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.67 2014/09/26 15:26:01 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -1526,10 +1526,14 @@
        | for_exprs stmnt {
                CLRWFLGS(__FILE__, __LINE__);
                for2();
+               popdecl();
+               blklev--;
          }
        | for_exprs error {
                CLRWFLGS(__FILE__, __LINE__);
                for2();
+               popdecl();
+               blklev--;
          }
        ;
 
@@ -1564,14 +1568,10 @@
                c99ism(325);
                for1(NULL, $6, $8);
                CLRWFLGS(__FILE__, __LINE__);
-               popdecl();
-               blklev--;
            }
          | for_start opt_expr T_SEMI opt_expr T_SEMI opt_expr T_RPARN {
                for1($2, $4, $6);
                CLRWFLGS(__FILE__, __LINE__);
-               popdecl();
-               blklev--;
          }
        ;
 



Home | Main Index | Thread Index | Old Index