diff options
author | David Mitchell <davem@iabyn.com> | 2012-11-11 00:01:21 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2012-11-11 00:01:21 +0000 |
commit | 3d26b81e83dca7175e314b31d265a01e1e9b0320 (patch) | |
tree | 0353cf491729d1cb26db261c0ae9fd931dff5857 /cop.h | |
parent | 285c5e4279bd1c29a0fad0f195fb22a65ac33ab2 (diff) | |
download | perl-3d26b81e83dca7175e314b31d265a01e1e9b0320.tar.gz |
make MULTICALL safe across cxstack reallocs
[perl #115602]
MUTLICALL sets a local var, cx, to point to the current context stack
frame. When a function is called, the context stack might be realloc()ed,
in which case cx would point to freed memory.
Diffstat (limited to 'cop.h')
-rw-r--r-- | cop.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1217,7 +1217,8 @@ See L<perlcall/LIGHTWEIGHT CALLBACKS>. #define POP_MULTICALL \ STMT_START { \ - if (! ((CvDEPTH(multicall_cv) = cx->blk_sub.olddepth)) ) { \ + cx = &cxstack[cxstack_ix]; \ + if (! ((CvDEPTH(multicall_cv) = cx->blk_sub.olddepth)) ) { \ LEAVESUB(multicall_cv); \ } \ POPBLOCK(cx,PL_curpm); \ |