[hackers] [scc] [cc1] Remove popctx() from compound() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 6 Feb 2017 16:47:18 +0100 (CET)

commit a84618bba7d82a3c2cd9f96bcf12344199174761
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Feb 6 16:45:05 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Feb 6 16:45:05 2017 +0100

    [cc1] Remove popctx() from compound()
    
    After the commit fea243a this popctx() it is not longer
    needed to happen in compound(), where it was a bit difficult
    to explain why it was needed, and it was very, very tricky.
    A better place where to pop the parameter context is in
    decl(), where it already pop the parameter context in the
    case of prototypes.

diff --git a/cc1/decl.c b/cc1/decl.c
index 004300f..4f7d273 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -899,6 +899,7 @@ decl(void)
         sym->flags &= ~SEMITTED;
         emit(OFUN, sym);
         compound(NULL, NULL, NULL);
+ popctx();
         emit(OEFUN, NULL);
         flushtypes();
         curfun = ocurfun;
diff --git a/cc1/stmt.c b/cc1/stmt.c
index dc778d0..b833c39 100644
--- a/cc1/stmt.c
+++ b/cc1/stmt.c
_AT_@ -362,12 +362,6 @@ compound(Symbol *lbreak, Symbol *lcont, Switch *lswitch)
         --nested;
 
         popctx();
- /*
- * curctx == GLOBALCTX+1 means we are at the end of a function
- * so we have to pop the context related to the parameters
- */
- if (curctx == GLOBALCTX+1)
- popctx();
         expect('}');
 }
 
Received on Mon Feb 06 2017 - 16:47:18 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 06 2017 - 16:48:23 CET