pbot-vm: guest-gdb: fix potential undefined `$start` when optimizations are enabled

This commit is contained in:
Pragmatic Software 2023-02-09 13:39:10 -08:00
parent 47d8f5724a
commit 224a00949a
2 changed files with 12 additions and 4 deletions

View File

@ -292,8 +292,16 @@ sub get_main_start_end($context) {
my ($line, $code) = split /\t/, $output->{_text};
# this line isn't part of main() yet
next if $line < $start;
if (not defined $start) {
# info functions didn't work, try to find main
if ($code =~ /main\s*\(/) {
$start = $line;
}
next;
} else {
# this line isn't part of main() yet
next if $line < $start;
}
# blank out contents of string and char literals so we don't count
# any braces within

View File

@ -25,8 +25,8 @@ use PBot::Imports;
# These are set by the /misc/update_version script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 4616,
BUILD_DATE => "2023-02-02",
BUILD_REVISION => 4617,
BUILD_DATE => "2023-02-09",
};
sub initialize {}