File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
crates/rustc_codegen_spirv/src/codegen_cx Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -456,12 +456,16 @@ impl<'tcx> CodegenCx<'tcx> {
456
456
// only uses the input alloc_id in the case that the scalar is uninitilized
457
457
// as part of the error output
458
458
// tldr, the pointer here is only needed for the offset
459
- let scalar = alloc
460
- . inner ( )
461
- . read_scalar ( self , alloc_range ( * offset, size) , primitive. is_ptr ( ) )
462
- . unwrap ( ) ;
463
- let value = self . scalar_to_backend ( scalar, self . primitive_to_scalar ( primitive) , ty) ;
464
-
459
+ let value = match alloc. inner ( ) . read_scalar (
460
+ self ,
461
+ alloc_range ( * offset, size) ,
462
+ primitive. is_ptr ( ) ,
463
+ ) {
464
+ Ok ( scalar) => {
465
+ self . scalar_to_backend ( scalar, self . primitive_to_scalar ( primitive) , ty)
466
+ }
467
+ _ => self . undef ( ty) ,
468
+ } ;
465
469
* offset += size;
466
470
value
467
471
}
You can’t perform that action at this time.
0 commit comments