diff options
-rw-r--r-- | emulator.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/emulator.cpp b/emulator.cpp index 92a615c..c793ddf 100644 --- a/emulator.cpp +++ b/emulator.cpp @@ -68,6 +68,9 @@ emulator::get_value(register_address addr) break; case REGISTER_TYPE_CONST: { + if (index >= m_const_regs.size()) { + return NULL; + } float_value * val = m_const_regs[index]; if (val->m_has_value) { |