From 647d194c710f5704f11d2db1ccd47fef8710d87b Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 21 Jul 2013 08:21:34 -0600 Subject: [PATCH] regcomp.c: Centralize assignment It's better to do something in one common place than two. This properly initializes the regex opcode for the synthetic start class when it is created, rather than at the end where the code has to be repeated to get all instances. --- regcomp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/regcomp.c b/regcomp.c index 5218395..3a17cc6 100644 --- a/regcomp.c +++ b/regcomp.c @@ -860,6 +860,7 @@ S_cl_init(const RExC_state_t *pRExC_state, struct regnode_charclass_class *cl) cl->type = ANYOF; cl_anything(pRExC_state, cl); ARG_SET(cl, ANYOF_NONBITMAP_EMPTY); + OP(cl) = ANYOF_SYNTHETIC; } /* These two functions currently do the exact same thing */ @@ -6307,7 +6308,6 @@ reStudy: && !cl_is_anything(data.start_class)) { const U32 n = add_data(pRExC_state, 1, "f"); - OP(data.start_class) = ANYOF_SYNTHETIC; Newx(RExC_rxi->data->data[n], 1, struct regnode_charclass_class); @@ -6380,7 +6380,6 @@ reStudy: && !cl_is_anything(data.start_class)) { const U32 n = add_data(pRExC_state, 1, "f"); - OP(data.start_class) = ANYOF_SYNTHETIC; Newx(RExC_rxi->data->data[n], 1, struct regnode_charclass_class); -- 2.7.4