Revision 0e079eba
Von Moritz Bunkus vor mehr als 14 Jahren hinzugefügt
bin/mozilla/common.pl | ||
---|---|---|
9 | 9 |
# |
10 | 10 |
###################################################################### |
11 | 11 |
|
12 |
use Carp; |
|
12 | 13 |
use SL::Common; |
13 | 14 |
use SL::DBUtils; |
14 | 15 |
use SL::Form; |
... | ... | |
508 | 509 |
|
509 | 510 |
# ------------------------------------------------------------------------- |
510 | 511 |
|
512 |
my %_called_subs = (); |
|
513 |
|
|
511 | 514 |
sub call_sub { |
512 | 515 |
$main::lxdebug->enter_sub(); |
513 | 516 |
|
... | ... | |
526 | 529 |
$form->error(sprintf($locale->text("Attempt to call an undefined sub named '%s'"), $name)); |
527 | 530 |
} |
528 | 531 |
|
532 |
$_called_subs{$name}++; |
|
533 |
confess "RECURSION DETECTION: call_sub($name) called " . $_called_subs{$name} . " time(s)" if $_called_subs{$name} > 10; |
|
534 |
|
|
529 | 535 |
{ |
530 | 536 |
no strict "refs"; |
531 | 537 |
&{ $name }(@_); |
Auch abrufbar als: Unified diff
Endlose Rekursionen via call_sub vermeiden.