diff options
author | Tom Stellard <tstellar@gmail.com> | 2010-12-16 15:18:29 -0800 |
---|---|---|
committer | Tom Stellard <tstellar@gmail.com> | 2010-12-16 15:18:29 -0800 |
commit | 038c976fd5709cf8fe647f7e0ace989737b37176 (patch) | |
tree | 2077e7d59b1915b65762a32fb2ddf8331f0dde29 | |
parent | 7aed76a98e718b3487787cec996025a14a93c96a (diff) |
emulator: Avoid segfault if an output reg is NULL
-rw-r--r-- | emulator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/emulator.cpp b/emulator.cpp index 4028550..607ec63 100644 --- a/emulator.cpp +++ b/emulator.cpp @@ -96,7 +96,7 @@ emulator::set_value( value * emulator::get_output_value(unsigned int index) { - if (index >= m_out_regs.size()) { + if (index >= m_out_regs.size() || !m_out_regs[index]) { return NULL; } return m_out_regs[index]->simplify(); |