summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-09-11 10:09:06 -0600
committerKarl Williamson <khw@cpan.org>2015-09-11 12:07:37 -0600
commit539601d8d15042c7077d7fecb1acd97058ddd274 (patch)
treeb0ac0fed483126cabf2435bd23647411ca6c9b88 /regcomp.c
parent82a6ada44d6e80d9ab64fe6a0334f04487506fdb (diff)
downloadperl-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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/regcomp.c b/regcomp.c
index c5a2dcaf52..b3702fc099 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -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;