Skip to content

Commit

Permalink
fix: Fix crash when hovering over non-existing instruction
Browse files Browse the repository at this point in the history
Co-authored-by: slavek-kucera <53339291+slavek-kucera@users.noreply.github.com>
  • Loading branch information
michalbali256 and slavek-kucera authored May 27, 2021
1 parent 480408d commit 3fbb22e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ void lsp_analyzer::collect_occurence(const semantics::instruction_si& instructio
{
auto opcode = hlasm_ctx_.get_operation_code(std::get<context::id_index>(instruction.value));
auto* macro_def = std::get_if<context::macro_def_ptr>(&opcode.opcode_detail);
collector.occurences.emplace_back(
opcode.opcode, macro_def ? std::move(*macro_def) : context::macro_def_ptr {}, instruction.field_range);
if (opcode.opcode || macro_def)
collector.occurences.emplace_back(
opcode.opcode, macro_def ? std::move(*macro_def) : context::macro_def_ptr {}, instruction.field_range);
}
}

Expand Down

0 comments on commit 3fbb22e

Please sign in to comment.