summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <tstellar@gmail.com>2010-12-16 15:18:29 -0800
committerTom Stellard <tstellar@gmail.com>2010-12-16 15:18:29 -0800
commit038c976fd5709cf8fe647f7e0ace989737b37176 (patch)
tree2077e7d59b1915b65762a32fb2ddf8331f0dde29
parent7aed76a98e718b3487787cec996025a14a93c96a (diff)
emulator: Avoid segfault if an output reg is NULL
-rw-r--r--emulator.cpp2
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();