codea: bugfix fuer ag-part...
authorBernhard Urban <lewurm@gmail.com>
Mon, 17 May 2010 23:53:40 +0000 (01:53 +0200)
committerBernhard Urban <lewurm@gmail.com>
Mon, 17 May 2010 23:53:40 +0000 (01:53 +0200)
codea/symtable.c
codea/tree.c

index b38500040d542ab5fce25f7226da6b2ce2009237..f8e4f21b6d8166406ba9ce10781eb453d07d242c 100755 (executable)
@@ -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);
index 3669383c735c89b7907e38b4cfbe416ab1fdb4b0..82d986a6fa921f2921683c615d361be301041d5e 100644 (file)
@@ -107,6 +107,7 @@ static void write_indent(int i)
 
 void write_tree(struct treenode *node, int indent)
 {
+       if(node == TREENULL) return;
        write_indent(indent);
        fprintf(stderr, "%s @ %%%s (%i). \"%s\"\n", o_names[node->op], node->reg, node->exprcount, node->name == (char*) NULL ? "" : node->name);
        if(node->kids[0] != TREENULL) {