From 0c60815d9167e0ecdb17fcc364ecee47f622660f Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 22 May 2002 22:59:40 +0000 Subject: [PATCH] Undo broken %elif change, and put in a big comment explaining why the existing code is correct. --- preproc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/preproc.c b/preproc.c index bdcf1dbb..34d14f36 100644 --- a/preproc.c +++ b/preproc.c @@ -2270,8 +2270,16 @@ do_directive(Token * tline) istk->conds->state = COND_NEVER; else { - j = if_condition(tline->next, i); - tline->next = NULL; /* it got freed */ + /* + * IMPORTANT: In the case of %if, we will already have + * called expand_mmac_params(); however, if we're + * processing an %elif we must have been in a + * non-emitting mode, which would have inhibited + * the normal invocation of expand_mmac_params(). Therefore, + * we have to do it explicitly here. + */ + j = if_condition(expand_mmac_params(tline->next), i); + tline->next = NULL; /* it got freed */ free_tlist(origline); istk->conds->state = j < 0 ? COND_NEVER : j ? COND_IF_TRUE : COND_IF_FALSE;