Skip to content

Commit 5265c66

Browse files
committed
dump.c: Fix broken c++ compilations in
Commit bce5eba broke c++ compilations because a goto now crosses declarations with initialization. This commit merely separates the declarations from their initialization, and moves the declarations to before the goto. The alternative could just as easily have been to move the goto to after the initialization, but the initialization would then be (a bit of) extra work, and more importantly, that would break the code flow of immediately using the initialized values.
1 parent 3812ecc commit 5265c66

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dump.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,8 @@ S_get_sv_from_pad(pTHX_ const OP *o, PADOFFSET po, CV *rootcv)
11261126
return NULL;
11271127

11281128
CV *cv = NULL;
1129+
int n;
1130+
OP *oproot;
11291131

11301132
if (rootcv) {
11311133
cv = rootcv;
@@ -1138,8 +1140,8 @@ S_get_sv_from_pad(pTHX_ const OP *o, PADOFFSET po, CV *rootcv)
11381140
* stack. Limit the number of hops, in case there is some sort of
11391141
* loop or other weirdness.
11401142
*/
1141-
int n = 100;
1142-
OP *oproot = (OP*)o;
1143+
n = 100;
1144+
oproot = (OP*)o;
11431145
while (1) {
11441146
if (--n <= 0)
11451147
return NULL;

0 commit comments

Comments
 (0)