diff options
author | Wim Taymans <wtaymans@redhat.com> | 2014-09-17 15:28:57 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2014-09-17 15:28:57 +0200 |
commit | fa62bd0444eb72e039b5a106a18385b82178eac4 (patch) | |
tree | 7acaa289eabde922302000f74c020bf37a770b89 /orc | |
parent | 42a1f65a23f5f51ace2b125741890723bede9606 (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.
Diffstat (limited to 'orc')
-rw-r--r-- | orc/orccompiler.c | 2 |
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; } } |