summaryrefslogtreecommitdiff
path: root/XSUB.h
diff options
context:
space:
mode:
authorDoug Bell <madcityzen@gmail.com>2015-06-02 22:34:42 -0500
committerDavid Mitchell <davem@iabyn.com>2015-10-02 11:29:35 +0100
commit9e77582c6bb40536b9ca4037729a9b0f2c7ff932 (patch)
treec7d6c93e6091f38e95f800db551be00b1b7bf68a /XSUB.h
parent052a7c766b9640ee847979cb9d2351a63e23a378 (diff)
downloadperl-9e77582c6bb40536b9ca4037729a9b0f2c7ff932.tar.gz
add assertion to prevent stack corruption in XSUB
We should not be able to return negative offsets from the stack in XSUBs.
Diffstat (limited to 'XSUB.h')
-rw-r--r--XSUB.h1
1 files changed, 1 insertions, 0 deletions
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<perlguts/"Exception Handling">.
#define XSRETURN(off) \
STMT_START { \
const IV tmpXSoff = (off); \
+ assert(tmpXSoff >= 0);\
PL_stack_sp = PL_stack_base + ax + (tmpXSoff - 1); \
return; \
} STMT_END