From: Vincent Pit Date: Mon, 9 Nov 2015 17:45:27 +0000 (-0200) Subject: Fix off-by-one error in su_uplevel_ud->si initialization X-Git-Tag: rt112246~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=commitdiff_plain;h=da5a83af50b62d200a1255f470a1403a342da901 Fix off-by-one error in su_uplevel_ud->si initialization si->si_cxmax is the last available context slot, hence should be -1 if we don't allocate any. --- diff --git a/Upper.xs b/Upper.xs index e54c013..f6ed5c6 100644 --- a/Upper.xs +++ b/Upper.xs @@ -384,7 +384,7 @@ static su_uplevel_ud *su_uplevel_ud_new(pTHX) { si->si_stack = newAV(); AvREAL_off(si->si_stack); si->si_cxstack = NULL; - si->si_cxmax = 0; + si->si_cxmax = -1; sud->si = si;