From: Vincent Pit Date: Sat, 4 Aug 2012 23:18:02 +0000 (+0200) Subject: Make sure all entries of MY_CXT.b__op_stashes are initialized X-Git-Tag: v0.51~10 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=f80e249f673c39ee8ba0dd58b26a3d5384448b61;p=perl%2Fmodules%2FVariable-Magic.git Make sure all entries of MY_CXT.b__op_stashes are initialized Otherwise CLONE may be testing uninitialized memory areas. --- diff --git a/Magic.xs b/Magic.xs index 997b45d..24f8d5c 100644 --- a/Magic.xs +++ b/Magic.xs @@ -1464,9 +1464,11 @@ PROTOTYPES: ENABLE BOOT: { HV *stash; + int c; MY_CXT_INIT; - MY_CXT.b__op_stashes[0] = NULL; + for (c = OPc_NULL; c < OPc_MAX; ++c) + MY_CXT.b__op_stashes[c] = NULL; #if VMG_THREADSAFE MUTEX_INIT(&vmg_vtable_refcount_mutex); MUTEX_INIT(&vmg_op_name_init_mutex);