mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-25 13:29:29 +01:00
pbot-vm: guest-gdb: fix potential undefined $start
when optimizations are enabled
This commit is contained in:
parent
47d8f5724a
commit
224a00949a
@ -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
|
||||
|
@ -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 {}
|
||||
|
Loading…
Reference in New Issue
Block a user