codea: chmod a-x symtable.*
[uebersetzerbau-ss10.git] / codea / symtable.c
old mode 100755 (executable)
new mode 100644 (file)
index b385000..4776240
@@ -40,7 +40,7 @@ struct symbol *tab_add_symbol(struct symbol *tab, char *ident, short type, short
                exit(4);
        }
 
-       if(tab_lookup(tab, ident, type) != SYMNULL) {
+       if(tab_lookup(tab, ident, type) != SYMNULL || (type == S_VAR && tab_lookup(tab, ident, S_PARM) != SYMNULL)) {
                if(check) {
                        fprintf(stderr, "Identifier doppelt vorhanden: \"%s\"\n", ident);
                        exit(3);
@@ -56,9 +56,7 @@ struct symbol *tab_add_symbol(struct symbol *tab, char *ident, short type, short
        new_elm->param_index = param_index;
        new_elm->soffset = soffset;
 
-       if(tab == SYMNULL) {
-               return new_elm;
-       }
+       if(tab == SYMNULL) return new_elm;
 
        while(elm->next != SYMNULL) {
                elm = elm->next;
@@ -72,9 +70,7 @@ struct symbol *tab_lookup(struct symbol *tab, char *ident, short type)
 {
        struct symbol *elm = tab;
 
-       if(tab == SYMNULL) {
-               return SYMNULL;
-       }
+       if(tab == SYMNULL) return SYMNULL;
 
        do {
                if((elm->type & type) && (strcmp(elm->ident, ident) == 0)) {