From 574bb301ff796c0840a285c0433d6885f9afdbca Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 17 Jun 2020 16:30:14 -0700 Subject: ptimize: move the definition of extrajmps to the block in which it's used. That makes it a bit clearer than it's not used outside that block; compilers and static analyzers can determine that, but this makes it easier for human analyzers to see that, and thus that it can neveer be bigger than 2. --- optimize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'optimize.c') diff --git a/optimize.c b/optimize.c index 1336a98d..2c9c4b39 100644 --- a/optimize.c +++ b/optimize.c @@ -2688,7 +2688,6 @@ convert_code_r(conv_state_t *conv_state, struct icode *ic, struct block *p) struct slist *src; u_int slen; u_int off; - u_char extrajmps; /* number of extra jumps inserted */ struct slist **offset = NULL; if (p == 0 || isMarked(ic, p)) @@ -2812,7 +2811,8 @@ filled: dst->code = (u_short)p->s.code; dst->k = p->s.k; if (JT(p)) { - extrajmps = 0; + /* number of extra jumps inserted */ + u_char extrajmps = 0; off = JT(p)->offset - (p->offset + slen) - 1; if (off >= 256) { /* offset too large for branch, must add a jump */ -- cgit v1.2.3