aboutsummaryrefslogtreecommitdiff
path: root/optimize.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-06-17 16:30:14 -0700
committerGuy Harris <gharris@sonic.net>2020-06-17 16:30:14 -0700
commit574bb301ff796c0840a285c0433d6885f9afdbca (patch)
tree67345e548d957f3d1b5d9cc321646b92633a117f /optimize.c
parent6a613e03c2aafe1e16a9efbc9f89e6d0f7a28155 (diff)
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.
Diffstat (limited to 'optimize.c')
-rw-r--r--optimize.c4
1 files changed, 2 insertions, 2 deletions
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 */