summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-01-04 11:11:49 -0600
committerJason Ekstrand <[email protected]>2019-01-08 00:38:30 +0000
commit427558a7178c704fd3102dc941d76316d9ca49e9 (patch)
tree3232b81bc766fd6828d87e446532b7ec15f8f4e4 /src/compiler
parente94a027af8953ba22f4daa3009ab71479b35c78f (diff)
nir/validate: Don't allow derefs in if conditions
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_validate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index 9f8455d21cc..df1e7b33004 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -493,6 +493,12 @@ validate_deref_instr(nir_deref_instr *instr, validate_state *state)
* pointers should be.
*/
validate_dest(&instr->dest, state, 0, 0);
+
+ /* Deref instructions as if conditions don't make sense because if
+ * conditions expect well-formed Booleans. If you want to compare with
+ * NULL, an explicit comparison operation should be used.
+ */
+ validate_assert(state, list_empty(&instr->dest.ssa.if_uses));
}
static void