summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2014-09-17 15:28:57 +0200
committerWim Taymans <wtaymans@redhat.com>2014-09-17 15:28:57 +0200
commitfa62bd0444eb72e039b5a106a18385b82178eac4 (patch)
tree7acaa289eabde922302000f74c020bf37a770b89
parent42a1f65a23f5f51ace2b125741890723bede9606 (diff)
compiler: avoid nagative array index
For instructions that don't have a second variable, don't try to index the variable array with a -1 index.
-rw-r--r--orc/orccompiler.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/orc/orccompiler.c b/orc/orccompiler.c
index 0086f77..bfb220f 100644
--- a/orc/orccompiler.c
+++ b/orc/orccompiler.c
@@ -927,7 +927,7 @@ orc_compiler_rewrite_vars2 (OrcCompiler *compiler)
compiler->vars[src2].alloc = 1;
} else {
int src2 = compiler->insns[j].src_args[1];
- if (compiler->vars[src2].alloc == 1) {
+ if (src2 != -1 && compiler->vars[src2].alloc == 1) {
compiler->vars[src2].alloc = 0;
}
}