Skip to content

Commit

Permalink
Fix an error print bug in dc
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Howard committed May 25, 2019
1 parent 3d59ce7 commit 4af0723
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/vm.c
Expand Up @@ -139,11 +139,17 @@ BcStatus bc_vm_error(BcError e, size_t line, ...) {
fprintf(stderr, bc_err_line, line);
}
else {

BcInstPtr *ip = bc_vec_item_rev(&vm->prog.stack, 0);
BcFunc *f = bc_vec_item(&vm->prog.fns, ip->func);

fprintf(stderr, "\n %s %s", vm->func_header, f->name);
if (ip->func != BC_PROG_MAIN && ip->func != BC_PROG_READ)

if (BC_IS_BC && ip->func != BC_PROG_MAIN &&
ip->func != BC_PROG_READ)
{
fprintf(stderr, "()");
}
}
}

Expand Down

0 comments on commit 4af0723

Please sign in to comment.