Skip to content

Commit

Permalink
[perl #123870] fixup trie runtime debug output
Browse files Browse the repository at this point in the history
The trie_words av may not exist if -Dr was not enabled at compile time,
so we must be more defensive for debug output at runtime.
  • Loading branch information
hvds committed Feb 18, 2015
1 parent c67aee7 commit d0bec20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions regexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -4422,8 +4422,8 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
DEBUG_EXECUTE_r({
AV *const trie_words
= MUTABLE_AV(rexi->data->data[ARG(ST.me)+TRIE_WORDS_OFFSET]);
SV ** const tmp = av_fetch( trie_words,
ST.nextword-1, 0 );
SV ** const tmp = trie_words
? av_fetch(trie_words, ST.nextword - 1, 0) : NULL;
SV *sv= tmp ? sv_newmortal() : NULL;

PerlIO_printf( Perl_debug_log,
Expand Down

0 comments on commit d0bec20

Please sign in to comment.