From: Nicholas Clark Date: Sat, 14 Oct 2006 23:06:52 +0000 (+0000) Subject: Avoid undefined behaviour for -DPERL_MEM_LOG by not using a X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f90039530aefc66446e68f0a752b598967d100ac;p=p5sagit%2Fp5-mst-13.2.git Avoid undefined behaviour for -DPERL_MEM_LOG by not using a dereference of member of the structure being reallocated as part of the size calculation. (This one was well hidden by macros) p4raw-id: //depot/perl@29018 --- diff --git a/regcomp.c b/regcomp.c index 7661432..86e6865 100644 --- a/regcomp.c +++ b/regcomp.c @@ -1133,9 +1133,8 @@ is the recommended Unicode-aware way of saying #define TRIE_LIST_PUSH(state,fid,ns) STMT_START { \ if ( TRIE_LIST_CUR( state ) >=TRIE_LIST_LEN( state ) ) { \ - TRIE_LIST_LEN( state ) *= 2; \ - Renew( trie->states[ state ].trans.list, \ - TRIE_LIST_LEN( state ), reg_trie_trans_le ); \ + U32 ging = TRIE_LIST_LEN( state ) *= 2; \ + Renew( trie->states[ state ].trans.list, ging, reg_trie_trans_le ); \ } \ TRIE_LIST_ITEM( state, TRIE_LIST_CUR( state ) ).forid = fid; \ TRIE_LIST_ITEM( state, TRIE_LIST_CUR( state ) ).newstate = ns; \