From 2a15e69ebe0c99a1997952e63c6702c05aa93db0 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 19 Nov 2007 13:14:59 -0800 Subject: [PATCH] Slightly faster implementation of the deadman counter Count down to zero instead of up to a constant... --- preproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/preproc.c b/preproc.c index f9c4de36..1de92855 100644 --- a/preproc.c +++ b/preproc.c @@ -2994,7 +2994,7 @@ static Token *expand_smacro(Token * tline) Token *org_tline = tline; Context *ctx; char *mname; - int deadman = 0; + int deadman = DEADMAN_LIMIT; /* * Trick: we should avoid changing the start token pointer since it can @@ -3016,7 +3016,7 @@ again: thead = NULL; while (tline) { /* main token loop */ - if (++deadman > DEADMAN_LIMIT) { + if (!--deadman) { error(ERR_NONFATAL, "interminable macro recursion"); break; } -- 2.11.4.GIT