Skip to content
Prev Previous commit
Next Next commit
Make sure we extend the stack before we start modifying it
  • Loading branch information
Ovid committed Jul 15, 2024
commit 4795c9c46b6fe751909dd3751098ea688b836688
2 changes: 1 addition & 1 deletion universal.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ XS(XS_UNIVERSAL_can)
}

if (pkg) {
EXTEND(SP, items - 1);
for (i = 1; i < items; i++) {
GV * const gv = gv_fetchmethod_sv_flags(pkg, ST(i), 0);
if (!gv || !isGV(gv) || !GvCV(gv))
Expand All @@ -516,7 +517,6 @@ XS(XS_UNIVERSAL_can)
ST(i-1) = sv_2mortal(newRV(MUTABLE_SV(GvCV(gv))));
}
}
EXTEND(SP, items - 1);
XSRETURN(items - 1);
}

Expand Down