summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beasm.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2018-05-28 22:21:36 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2018-05-29 08:54:43 +0200
commite7a96ec68c8fb9637f067f14e47e0b5f90a0386b (patch)
treed46f28ae309772f4b6c2862b35942214d001c17a /ir/be/beasm.c
parent86250b27eba9604ce47606f7b2d35793b5104a69 (diff)
be: Assert that the register class index for additional pressure is valid.
Diffstat (limited to 'ir/be/beasm.c')
-rw-r--r--ir/be/beasm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ir/be/beasm.c b/ir/be/beasm.c
index 39e0ff6..416c65c 100644
--- a/ir/be/beasm.c
+++ b/ir/be/beasm.c
@@ -289,6 +289,7 @@ ir_node *be_make_asm(ir_node const *const node, be_asm_info_t const *const info,
bitset_t *const used_ins = bitset_alloca(orig_n_ins);
for (size_t o = pn_be_Asm_first_out; o < orig_n_outs; ++o) {
arch_register_req_t const *const outreq = out_reqs[o];
+ assert(outreq->cls->index < ARRAY_SIZE(add_pressure));
if (!match_requirement(in_reqs, orig_n_ins, used_ins, outreq))
add_pressure[outreq->cls->index]++;
}
@@ -296,6 +297,7 @@ ir_node *be_make_asm(ir_node const *const node, be_asm_info_t const *const info,
bitset_t *const used_outs = bitset_alloca(orig_n_outs);
for (unsigned i = n_be_Asm_first_in; i < orig_n_ins; ++i) {
arch_register_req_t const *const inreq = in_reqs[i];
+ assert(inreq->cls->index < ARRAY_SIZE(add_pressure));
if (!match_requirement(out_reqs, orig_n_outs, used_outs, inreq))
add_pressure[inreq->cls->index]++;
}