From 362fda4d18d5def21c63905bc1d5ef01116ef397 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Thu, 14 Jan 2016 13:22:56 -0800 Subject: [PATCH] Check "in eval?" variable instead of walking the call stack The issue queue is closed in this repository, or I would have simply filed an issue.. apologies if you have a queue somewhere else. But see `perldoc perlvar` -- you can just check `$^S` to see if you're in an eval, rather than walking the call stack. --- Bugzilla/Sentry.pm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Bugzilla/Sentry.pm b/Bugzilla/Sentry.pm index e9dedc8dd9..7e3a367c7d 100644 --- a/Bugzilla/Sentry.pm +++ b/Bugzilla/Sentry.pm @@ -301,13 +301,7 @@ sub _write_to_error_log { # lifted from Bugzilla::Error sub _in_eval { - my $in_eval = 0; - for (my $stack = 1; my $sub = (caller($stack))[3]; $stack++) { - last if $sub =~ /^ModPerl/; - last if $sub =~ /^Bugzilla::Template/; - $in_eval = 1 if $sub =~ /^\(eval\)/; - } - return $in_eval; + return $^S; } sub _sentry_die_handler {