Skip to content

Commit

Permalink
some assertions and try-outs.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjs committed Jun 18, 2012
1 parent 8cd6dd6 commit cac108e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gencode.c
Expand Up @@ -1336,7 +1336,7 @@ gencode_funcall(M1_compiler *comp, m1_funcall *f) {
*/

fun = sym_find_chunk(&comp->currentchunk->constants, f->name);

// assert(fun == f->funsym);
/* XXX enable this as soon as it's resolved. */
//assert(fun->constindex == f->funsym->constindex);

Expand Down
3 changes: 2 additions & 1 deletion src/m1.y
Expand Up @@ -511,8 +511,9 @@ function_init : return_type TK_IDENT

/* enter name of function declaration in table
XXX is this still needed? Dont think so but leave it for now.
sym_enter_chunk(comp, &comp->currentchunk->constants, $2);
*/
//sym_enter_chunk(comp, &comp->currentchunk->constants, $2);


/* enter name of function in global symbol table. */
sym_new_symbol(comp, comp->globalsymtab, $2, $1, 1);
Expand Down
1 change: 1 addition & 0 deletions src/semcheck.c
Expand Up @@ -441,6 +441,7 @@ check_funcall(M1_compiler *comp, m1_funcall *f, unsigned line) {
assert(line != 0);

f->funsym = sym_lookup_symbol(comp->globalsymtab, f->name);
//f->funsym = sym_find_chunk(comp->globalsymtab, f->name);

if (f->funsym == NULL) {
type_error(comp, line, "function '%s' not defined", f->name);
Expand Down

0 comments on commit cac108e

Please sign in to comment.