aboutsummaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2025-01-03 11:01:53 -0800
committerRichard Henderson <richard.henderson@linaro.org>2025-01-16 20:57:16 -0800
commitb277cdd20baf6d8579aa5a874f713f9e19833c9f (patch)
tree3e948061cc7bb5b64002e191ee8a66327e722b72 /tcg
parented1a653bad46752c4c4ceb2ada774dff7cd79e81 (diff)
downloadqemu-b277cdd20baf6d8579aa5a874f713f9e19833c9f.zip
qemu-b277cdd20baf6d8579aa5a874f713f9e19833c9f.tar.gz
qemu-b277cdd20baf6d8579aa5a874f713f9e19833c9f.tar.bz2
tcg: Validate op supported in opcode_args_ct
We should have checked that the op is supported before emitting it. The backend cannot be expected to have a constraint set for unsupported ops. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/tcg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 32975fe..b9119a1 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -3367,6 +3367,10 @@ static const TCGArgConstraint *opcode_args_ct(const TCGOp *op)
const TCGOpDef *def = &tcg_op_defs[op->opc];
TCGConstraintSetIndex con_set;
+#ifdef CONFIG_DEBUG_TCG
+ assert(tcg_op_supported(op->opc, TCGOP_TYPE(op), TCGOP_FLAGS(op)));
+#endif
+
if (def->nb_iargs + def->nb_oargs == 0) {
return NULL;
}