int i;
BRefNode* br = BREF_(node);
int* backs = BACKREFS_P(br);
+ MemEnv* mem_env = SCANENV_MEMENV(env);
for (i = 0; i < br->back_num; i++) {
if (backs[i] > env->num_mem)
return ONIGERR_INVALID_BACKREF;
+
+ NODE_STATUS_ADD(mem_env[backs[i]].node, NST_BACKREF);
}
r = 0;
}
#define NST_NEST_LEVEL (1<<13)
#define NST_BY_NUMBER (1<<14) /* {n,m} */
#define NST_BY_NAME (1<<15) /* backref by name */
+#define NST_BACKREF (1<<16)
#define NODE_STATUS(node) (((Node* )node)->u.base.status)
#define NODE_IS_MARK2(node) ((NODE_STATUS(node) & NST_MARK2) != 0)
#define NODE_IS_NEST_LEVEL(node) ((NODE_STATUS(node) & NST_NEST_LEVEL) != 0)
#define NODE_IS_BY_NAME(node) ((NODE_STATUS(node) & NST_BY_NAME) != 0)
+#define NODE_IS_BACKREF(node) ((NODE_STATUS(node) & NST_BACKREF) != 0)
#define NODE_IS_STOP_BT_SIMPLE_REPEAT(node) \
((NODE_STATUS(node) & NST_STOP_BT_SIMPLE_REPEAT) != 0)