Commit a71385d
committed
perl5db: use a lexical copy of $DB::sub inside DB::sub
When perl calls DB::sub in the debugger, it sets $DB::sub to the sub
being called. If we trigger any other subs to get called somewhere
inside DB::sub, this could cause DB::sub to be called again, overwriting
the global. Perl won't call DB::sub for any sub calls within the DB
namespace, but we could inadvertently trigger this via a sub override or
magic, like overloads.
Create a copy of the global value in a lexical to use inside the sub, to
avoid it ever getting overwritten.1 parent 148136c commit a71385d
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4434 | 4434 | | |
4435 | 4435 | | |
4436 | 4436 | | |
| 4437 | + | |
| 4438 | + | |
| 4439 | + | |
| 4440 | + | |
| 4441 | + | |
4437 | 4442 | | |
4438 | 4443 | | |
4439 | 4444 | | |
| |||
4568 | 4573 | | |
4569 | 4574 | | |
4570 | 4575 | | |
| 4576 | + | |
4571 | 4577 | | |
4572 | 4578 | | |
4573 | 4579 | | |
| |||
0 commit comments