]> granicus.if.org Git - onig/commitdiff
guard to duplicated call by NST_MARK1 in another recursive call
authorK.Kosako <kosako@sofnec.co.jp>
Tue, 20 Jun 2017 01:54:26 +0000 (10:54 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Tue, 20 Jun 2017 01:54:26 +0000 (10:54 +0900)
src/regcomp.c

index ec88b636b0a4acc58c7fdb3c8c8c4a5fe73aa355..b704c50bf8a7357fd90303728b862f4ed6d228a6 100644 (file)
@@ -3764,13 +3764,17 @@ setup_call2_call(Node* node, ScanEnv* env)
     break;
 
   case NODE_CALL:
-    {
-      CallNode* cn = CALL_(node);
-      Node* called = NODE_CALL_BODY(cn);
+    if (! NODE_IS_MARK1(node)) {
+      NODE_STATUS_ADD(node, NST_MARK1);
+      {
+        CallNode* cn = CALL_(node);
+        Node* called = NODE_CALL_BODY(cn);
 
-      NODE_STATUS_ADD(called, NST_CALLED);
-      ENCLOSURE_(called)->entry_count++;
-      setup_call2_call(called, env);
+        NODE_STATUS_ADD(called, NST_CALLED);
+        ENCLOSURE_(called)->entry_count++;
+        setup_call2_call(called, env);
+      }
+      NODE_STATUS_REMOVE(node, NST_MARK1);
     }
     break;