File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ use alloc::vec::Vec;
104104use alloc:: { format, vec} ;
105105use core:: default:: Default ;
106106use core:: hash:: Hash ;
107+ use core:: ops:: Range ;
107108use core:: result:: Result ;
108109use smallvec:: { smallvec, SmallVec } ;
109110
@@ -166,6 +167,12 @@ pub enum CheckerError {
166167 into : Allocation ,
167168 from : Allocation ,
168169 } ,
170+ AllocationOutsideLimit {
171+ inst : Inst ,
172+ op : Operand ,
173+ alloc : Allocation ,
174+ range : Range < usize > ,
175+ } ,
169176}
170177
171178/// Abstract state for an allocation.
@@ -669,6 +676,18 @@ impl CheckerState {
669676 } ) ;
670677 }
671678 }
679+ OperandConstraint :: Limit ( max) => {
680+ if let Some ( preg) = alloc. as_reg ( ) {
681+ if preg. hw_enc ( ) >= max {
682+ return Err ( CheckerError :: AllocationOutsideLimit {
683+ inst,
684+ op,
685+ alloc,
686+ range : ( 0 ..max) ,
687+ } ) ;
688+ }
689+ }
690+ }
672691 }
673692 Ok ( ( ) )
674693 }
You can’t perform that action at this time.
0 commit comments