+ regnum = ++bufp->re_nsub;
+ else if (regnum)
+ { /* It's actually not shy, but explicitly numbered. */
+ shy = 0;
+ if (regnum > bufp->re_nsub)
+ bufp->re_nsub = regnum;
+ else if (regnum > bufp->re_nsub
+ /* Ideally, we'd want to check that the specified
+ group can't have matched (i.e. all subgroups
+ using the same regnum are in other branches of
+ OR patterns), but we don't currently keep track
+ of enough info to do that easily. */
+ || group_in_compile_stack (compile_stack, regnum))
+ FREE_STACK_RETURN (REG_BADPAT);