From: Justin Seyster Date: Thu, 28 Oct 2010 00:09:01 +0000 (-0400) Subject: Fixed bug where entry pointcut wouldn't know the filename/lineno. X-Git-Tag: release-v1.0~6 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=914c58c59847f9b8884bf85e4c72527dc6fce60f;p=interaspect.git Fixed bug where entry pointcut wouldn't know the filename/lineno. In this case, if the user called aop_duplicate() with a captured in_param. --- diff --git a/src/aop-weave.c b/src/aop-weave.c index 711e753..ca8fc02 100644 --- a/src/aop-weave.c +++ b/src/aop-weave.c @@ -41,6 +41,8 @@ #include #include #include +#include + #include /* Defining GENERATOR_FILE prevents real.h from also including the @@ -456,12 +458,22 @@ insert_stmts_at_entry (VEC(gimple, heap) *stmt_list) int i; edge in_edge; gimple stmt; + gimple entry_stmt; + + entry_stmt = first_stmt (ENTRY_BLOCK_PTR_FOR_FUNCTION (cfun)->next_bb); /* Get the edge for the main entry point. */ in_edge = single_succ_edge (ENTRY_BLOCK_PTR_FOR_FUNCTION (cfun)); for (i = 0; VEC_iterate (gimple, stmt_list, i, stmt); i++) - gsi_insert_on_edge_immediate (in_edge, stmt); + { + /* This is so entry pointcut functions can still tell what the + line number/filename is for this function's entry. */ + if (first_stmt != NULL) + gimple_set_location (stmt, gimple_location (entry_stmt)); + + gsi_insert_on_edge_immediate (in_edge, stmt); + } } /**