From e8f564dc834f69bd64beee650ca9b805772d418b Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sat, 13 Nov 2021 13:58:45 -0800 Subject: [PATCH] [spv-out] Add comment about AccessIndex on non-pointer values. --- src/back/spv/block.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/back/spv/block.rs b/src/back/spv/block.rs index 89f893a31e..eaa4b79907 100644 --- a/src/back/spv/block.rs +++ b/src/back/spv/block.rs @@ -226,6 +226,10 @@ impl<'w> BlockContext<'w> { | crate::TypeInner::Matrix { .. } | crate::TypeInner::Array { .. } | crate::TypeInner::Struct { .. } => { + // We never need bounds checks here: dynamically sized arrays can + // only appear behind pointers, and are thus handled by the + // `is_intermediate` case above. Everything else's size is + // statically known and checked in validation. let id = self.gen_id(); let base_id = self.cached[base]; block.body.push(Instruction::composite_extract(