From 31a13a8931c6d662327440edc152eb03da466c45 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 19 Jan 2000 17:35:54 +0000 Subject: zsh-workers/9367 --- Src/cond.c | 7 ++++--- Src/parse.c | 13 ++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'Src') diff --git a/Src/cond.c b/Src/cond.c index 4a78bd5e7..1df5b5617 100644 --- a/Src/cond.c +++ b/Src/cond.c @@ -43,7 +43,8 @@ evalcond(Estate state) { struct stat *st; char *left, *right = NULL; - wordcode code = *state->pc++; + Wordcode pcode = state->pc++; + wordcode code = *pcode; int ctype = WC_COND_TYPE(code); switch (ctype) { @@ -57,7 +58,7 @@ evalcond(Estate state) fprintf(stderr, " %s", condstr[ctype]); return evalcond(state); } else { - state->pc += WC_COND_SKIP(code) - 1; + state->pc = pcode + (WC_COND_SKIP(code) + 1); return 0; } case COND_OR: @@ -66,7 +67,7 @@ evalcond(Estate state) fprintf(stderr, " %s", condstr[ctype]); return evalcond(state); } else { - state->pc += WC_COND_SKIP(code) - 1; + state->pc = pcode + (WC_COND_SKIP(code) + 1); return 1; } case COND_MOD: diff --git a/Src/parse.c b/Src/parse.c index 11aa0b60f..ecb88536b 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -1727,7 +1727,7 @@ yyerror(int noerr) * Word code layout: * * WC_END - * - only used for empty functions + * - end of program code * * WC_LIST * - data contains type (sync, ...) @@ -2217,6 +2217,14 @@ ecomp(struct node *n) } } break; + case N_COND: + eccond((Cond) n); + break; +#ifdef DEBUG + default: + dputs("BUG: node type not handled in ecomp()."); + break; +#endif } } @@ -2335,8 +2343,7 @@ execompile(List list) ecsoffs = ecnpats = 0; ec(list); - if (!ecused) - ecadd(WCB_END()); + ecadd(WCB_END()); ret = (Eprog) zhalloc(sizeof(*ret)); ret->len = ((ecnpats * sizeof(Patprog)) + -- cgit 1.4.1