Don't issue the linestr callback if the const op comes from m//, s///, qr// or tr///.
Florian Ragwitz [Thu, 9 Apr 2009 00:35:42 +0000 (00:35 +0000)]
Declare.xs

index 37e0bdc..7e96835 100644 (file)
@@ -340,6 +340,18 @@ STATIC OP *dd_ck_const(pTHX_ OP *o, void *user_data) {
   if (dd_flags == -1)
     return o;
 
+  if (previous_op != NULL) {
+    switch (previous_op->op_type) {
+      case OP_QR:
+      case OP_MATCH:
+      case OP_SUBST:
+      case OP_TRANS:
+        return o;
+        break;
+      default:
+        break;
+    }
+  }
   dd_linestr_callback(aTHX_ "const", name);
 
   return o;