Ensure enough data available while disassembling
This commit is contained in:
parent
1d32f27680
commit
a015ab8708
@ -31,6 +31,7 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
// Ext
|
// Ext
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
|
@ -71,6 +71,7 @@ void disassembler::dissasemble_function(const gsc::function_ptr& func)
|
|||||||
func->instructions.push_back(std::make_unique<gsc::instruction>());
|
func->instructions.push_back(std::make_unique<gsc::instruction>());
|
||||||
auto& inst = func->instructions.back();
|
auto& inst = func->instructions.back();
|
||||||
inst->index = static_cast<std::uint32_t>(script_->pos());
|
inst->index = static_cast<std::uint32_t>(script_->pos());
|
||||||
|
assert(script_->is_avail());
|
||||||
inst->opcode = script_->read<std::uint8_t>();
|
inst->opcode = script_->read<std::uint8_t>();
|
||||||
inst->size = opcode_size(inst->opcode);
|
inst->size = opcode_size(inst->opcode);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user