Fixed ugly duplication bug.
authorJustin Seyster <jseyster@cs.sunysb.edu>
Wed, 27 Oct 2010 23:49:43 +0000 (19:49 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Thu, 28 Oct 2010 00:28:12 +0000 (20:28 -0400)
Sort of a hack.  I've managed worse, though.

src/aop-pointcut.c

index 098e9bc065382dd8452f7d5dec0e006387cb4de9..fe3e47aaeb15c17859d483c1789d4a92b36c542b 100644 (file)
@@ -124,13 +124,21 @@ op_get_in_param (struct aop_dynval *dv)
     {
       if (index == dv->dynval_in_param.param_index)
        {
-         param = save_param (param_iter);
+         param = param_iter;
          break;
        }
       index++;       
     }  
 
   aop_assert (param != NULL);
+
+  /* HACK: It's not necessary to save the parameter if this is an
+     entry join point (there won't be any time for the variable to
+     change).  That's good because save_param() doesn't work right if
+     we're in the process of an aop_duplicate(). */
+  if (jp->pc->kind != ATP_ENTRY)
+    param = save_param (param);
+
   return param;
 }