From 37e2b2e7531d5b5bf295d6c4745d19c31ecab1e9 Mon Sep 17 00:00:00 2001 From: Ketan Dixit Date: Mon, 7 Jun 2010 18:48:42 -0400 Subject: [PATCH] Order of prepare_for_weave and insert advice is fixed --- src/aop-weave.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; + } -- 2.43.0