summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhaas <rhaas@17b73243-c579-4c4c-a9d2-2d5706c11dac>2013-06-05 15:27:27 +0000
committerrhaas <rhaas@17b73243-c579-4c4c-a9d2-2d5706c11dac>2013-06-05 15:27:27 +0000
commit37db25307ea9afea486d750f385e78d65eac52d9 (patch)
treed8d943b43943d7c13ffd7ab60a3f9eb93f6c845f
parent5b94158928425086d838aaf7a18579c309cf6b24 (diff)
check that providing function name is different from aliased function name
in interface.ccl. Before f an aliased function is declared in interface.ccl with PROVIDES FUNCTION fun WITH fun LANGUAGE C Cactus went into an infinite loop when calling that function. It did so because it creates a function 'fun' (the first) itself, which then calls (fun) the second. Instead, Cactus now produces an error for above declaration. The two 'fun' must be different for this to work, and Cactus should catch this. Reported by Frank Loeffler in ticket 1376. git-svn-id: http://svn.cactuscode.org/flesh/trunk@5024 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r--lib/sbin/interface_parser.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sbin/interface_parser.pl b/lib/sbin/interface_parser.pl
index 2746030e..871a4fc7 100644
--- a/lib/sbin/interface_parser.pl
+++ b/lib/sbin/interface_parser.pl
@@ -754,6 +754,15 @@ sub parse_interface_ccl
}
+ if($funcname eq $provided_by) {
+ my $message = "The providing function $provided_by in thorn $thorn " .
+ "has a name that is identical to the name of the provided " .
+ "function $funcname. The names must be different.";
+ my $hint = "Rename the providing function by prefixing its name with ".
+ "'${thorn}_'.";
+ &CST_error(0, $message, $hint, __LINE__, __FILE__);
+ }
+
$interface_data_ref->{"\U$thorn PROVIDES FUNCTION\E"} .= "$funcname ";
$interface_data_ref->{"\U$thorn PROVIDES FUNCTION\E $funcname WITH"} .= "$provided_by ";
$interface_data_ref->{"\U$thorn PROVIDES FUNCTION\E $funcname LANG"} .= "$provided_by_language ";