diff options
author | Eric Anholt <[email protected]> | 2018-01-19 09:06:26 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2018-02-01 11:02:29 -0800 |
commit | 353b42ccc745453dffe742d766831248f77d6e39 (patch) | |
tree | 8fb2fa5d74f06fd26ee47e69446717cbbba42cc7 /src/broadcom/compiler | |
parent | eb765394c2fd8232158fe02c8644309657dc1fe3 (diff) |
broadcom/vc5: Fix a segfault on mix of booleans.
We don't have a src1 to look up if the compare instruction is "i2b".
Diffstat (limited to 'src/broadcom/compiler')
-rw-r--r-- | src/broadcom/compiler/nir_to_vir.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index 0e2e8e2daad..6bb27741437 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -528,7 +528,9 @@ ntq_emit_comparison(struct v3d_compile *c, struct qreg *dest, nir_alu_instr *sel_instr) { struct qreg src0 = ntq_get_alu_src(c, compare_instr, 0); - struct qreg src1 = ntq_get_alu_src(c, compare_instr, 1); + struct qreg src1; + if (nir_op_infos[compare_instr->op].num_inputs > 1) + src1 = ntq_get_alu_src(c, compare_instr, 1); bool cond_invert = false; switch (compare_instr->op) { |