From: Ketan Dixit Date: Mon, 7 Jun 2010 22:48:42 +0000 (-0400) Subject: Order of prepare_for_weave and insert advice is fixed X-Git-Tag: release-v1.0~102 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=37e2b2e7531d5b5bf295d6c4745d19c31ecab1e9;p=interaspect.git Order of prepare_for_weave and insert advice is fixed --- diff --git a/src/aop-weave.c b/src/aop-weave.c index f5465b7..d4b2682 100644 --- a/src/aop-weave.c +++ b/src/aop-weave.c @@ -175,10 +175,6 @@ aop_insert_advice (struct aop_joinpoint *jp, const char *func_name, gimple func_call; struct aop_pointcut *pc; - va_start (argp, location); - func_call = build_gcc_call (func_name, void_type_node, argp); - va_end (argp); - pc = jp->pc; /* Make sure this joinpoint is prepared for advice. */ @@ -188,9 +184,13 @@ aop_insert_advice (struct aop_joinpoint *jp, const char *func_name, jp->is_prepared = true; } + va_start (argp, location); + func_call = build_gcc_call (func_name, void_type_node, argp); + va_end (argp); + if(location == AOP_INSERT_BEFORE) pc->insert_before(jp, func_call); else if(location == AOP_INSERT_AFTER) pc->insert_after(jp, func_call); - pc = jp->pc; + }