From 0142dcb990eee047af9e7f520bf7a27f6ef765b1 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 27 Aug 2019 11:12:02 +0200 Subject: [PATCH] panfrost: Make sure bundle.instructions[] contains valid instructions Add an assert() in schedule_bundle() to make sure all instruction pointers in bundle.instructions[] are valid. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index f80a0354fb8..60ad5ebb79c 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -562,6 +562,7 @@ schedule_bundle(compiler_context *ctx, midgard_block *block, midgard_instruction midgard_instruction *uins = ins; for (; packed_idx < bundle.instruction_count; ++packed_idx) { + assert(&uins->link != &block->instructions); bundle.instructions[packed_idx] = uins; uins = mir_next_op(uins); } -- 2.30.2