diff options
author | Karl Williamson <khw@cpan.org> | 2015-09-11 10:09:06 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-09-11 12:07:37 -0600 |
commit | 539601d8d15042c7077d7fecb1acd97058ddd274 (patch) | |
tree | b0ac0fed483126cabf2435bd23647411ca6c9b88 /regcomp.c | |
parent | 82a6ada44d6e80d9ab64fe6a0334f04487506fdb (diff) | |
download | perl-539601d8d15042c7077d7fecb1acd97058ddd274.tar.gz |
regcomp.c: Reorder a test
Prior to this commit, the code tested for some side effects before
testing if the called function even succeeded. This hasn't been a
problem before, because the called function didn't fail when called
from this context. But a future commit will change that.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -11737,16 +11737,16 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth) (bool) RExC_strict, TRUE, /* Allow an optimized regnode result */ NULL); - if (*RExC_parse != ']') { - RExC_parse = oregcomp_parse; - vFAIL("Unmatched ["); - } if (ret == NULL) { if (*flagp & RESTART_UTF8) return NULL; FAIL2("panic: regclass returned NULL to regatom, flags=%#"UVxf"", (UV) *flagp); } + if (*RExC_parse != ']') { + RExC_parse = oregcomp_parse; + vFAIL("Unmatched ["); + } nextchar(pRExC_state); Set_Node_Length(ret, RExC_parse - oregcomp_parse + 1); /* MJD */ break; |