From 37db25307ea9afea486d750f385e78d65eac52d9 Mon Sep 17 00:00:00 2001 From: rhaas Date: Wed, 5 Jun 2013 15:27:27 +0000 Subject: 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 --- lib/sbin/interface_parser.pl | 9 +++++++++ 1 file changed, 9 insertions(+) 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 "; -- cgit v1.2.3