From 9e77582c6bb40536b9ca4037729a9b0f2c7ff932 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Tue, 2 Jun 2015 22:34:42 -0500 Subject: add assertion to prevent stack corruption in XSUB We should not be able to return negative offsets from the stack in XSUBs. --- XSUB.h | 1 + 1 file changed, 1 insertion(+) (limited to 'XSUB.h') diff --git a/XSUB.h b/XSUB.h index 4548fc99b8..e64bc83b92 100644 --- a/XSUB.h +++ b/XSUB.h @@ -327,6 +327,7 @@ Rethrows a previously caught exception. See L. #define XSRETURN(off) \ STMT_START { \ const IV tmpXSoff = (off); \ + assert(tmpXSoff >= 0);\ PL_stack_sp = PL_stack_base + ax + (tmpXSoff - 1); \ return; \ } STMT_END -- cgit v1.2.1