[5/5] panfrost: Make sure bundle.instructions[] contains valid instructions

Submitted by Boris Brezillon on Aug. 27, 2019, 10:36 a.m.

Details

Message ID 20190827103644.16346-5-boris.brezillon@collabora.com
State Accepted
Commit 0142dcb990eee047af9e7f520bf7a27f6ef765b1
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Boris Brezillon Aug. 27, 2019, 10:36 a.m.
Add an assert() in schedule_bundle() to make sure all instruction
pointers in bundle.instructions[] are valid.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 src/panfrost/midgard/midgard_schedule.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c
index 1a22e683c3d3..f04a5c46a5dc 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);
         }