&& !(sel->cdata->flags & SEL_CDATA_SIMPLESUBEXPR)
&& (sel->cdata->flags & SEL_CDATA_FULLEVAL))
{
- sel->flags |= SEL_ALLOCVAL;
- sel->flags |= (sel->child->flags & SEL_ALLOCDATA);
- sel->v.nalloc = sel->child->v.nalloc;
- sel->child->flags &= ~(SEL_ALLOCVAL | SEL_ALLOCDATA);
+ sel->flags |= SEL_ALLOCVAL;
+ sel->flags |= (sel->child->flags & SEL_ALLOCDATA);
+ sel->v.nalloc = sel->child->v.nalloc;
+ sel->child->flags &= ~(SEL_ALLOCVAL | SEL_ALLOCDATA);
sel->child->v.nalloc = -1;
}
+
+ /* For static subexpressions with a dynamic evaluation group, there is
+ * no need to evaluate them again, as the SEL_SUBEXPRREF takes care of
+ * everything during evaluation. */
+ if (sel->type == SEL_SUBEXPR
+ && (sel->cdata->flags & SEL_CDATA_SIMPLESUBEXPR)
+ && (sel->cdata->flags & SEL_CDATA_STATICMULTIEVALSUBEXPR))
+ {
+ sel->evaluate = NULL;
+ sel->cdata->evaluate = NULL;
+ }
}