Skip to content

Commit aeff225

Browse files
committed
cop.h - fix warnings about i across setjmp
We can just do the count before and after.
1 parent 202773e commit aeff225

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cop.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ typedef struct jmpenv JMPENV;
112112

113113
#define JMPENV_PUSH(v) \
114114
STMT_START { \
115-
PERL_DEB(int i=0); \
116115
DEBUG_l({ \
116+
int i = 0; \
117117
JMPENV *p = PL_top_env; \
118118
while (p) { i++; p = p->je_prev; } \
119+
Perl_deb(aTHX_ "JMPENV_PUSH pre level=%d at %s:%d\n", \
120+
i, __FILE__, __LINE__); \
119121
}); \
120122
cur_env.je_prev = PL_top_env; \
121123
JE_OLD_STACK_HWM_save(cur_env); \
@@ -124,11 +126,14 @@ typedef struct jmpenv JMPENV;
124126
PL_top_env = &cur_env; \
125127
cur_env.je_mustcatch = FALSE; \
126128
cur_env.je_old_delaymagic = PL_delaymagic; \
127-
(v) = cur_env.je_ret; \
128129
DEBUG_l({ \
130+
int i = 0; \
131+
JMPENV *p = PL_top_env; \
132+
while (p) { i++; p = p->je_prev; } \
129133
Perl_deb(aTHX_ "JMPENV_PUSH level=%d ret=%d at %s:%d\n", \
130134
i, cur_env.je_ret, __FILE__, __LINE__); \
131135
}); \
136+
(v) = cur_env.je_ret; \
132137
} STMT_END
133138

134139
#define JMPENV_POP \

0 commit comments

Comments
 (0)