Fix segv on uninitialized command fields.
This commit is contained in:
@@ -65,10 +65,10 @@ struct AddressPromise {
|
||||
struct Command {
|
||||
bool temp_address{false};
|
||||
std::vector<AddressPromise> addresses{};
|
||||
functions::Function *function;
|
||||
functions::Function::Argument argument;
|
||||
functions::Function *function{nullptr};
|
||||
functions::Function::Argument argument{std::monostate()};
|
||||
std::vector<AddressPromise> argument_addresses{};
|
||||
functions::Suffix *suffix;
|
||||
functions::Suffix *suffix{nullptr};
|
||||
};
|
||||
|
||||
struct CompletionContext {
|
||||
|
||||
+2
-1
@@ -124,7 +124,8 @@ void BEd::handle(std::string_view cmd, bool eof) {
|
||||
throw ed_error("Line number can't be zero.");
|
||||
}
|
||||
}
|
||||
c.function->handle(*this, address, nullptr, c.argument, nullptr);
|
||||
if (c.function->handle)
|
||||
c.function->handle(*this, address, nullptr, c.argument, nullptr);
|
||||
if (c.suffix)
|
||||
c.suffix->handle(*this);
|
||||
if (c.temp_address)
|
||||
|
||||
Reference in New Issue
Block a user