2323
2424 from .smir import SMIRInfo
2525 from .ty import TypeMetadata
26- from .value import Metadata , Value
26+ from .value import MetadataSize , Value
2727
2828
2929_LOGGER : Final = logging .getLogger (__name__ )
@@ -312,6 +312,14 @@ def _fresh_var(self, prefix: str) -> KVariable:
312312
313313 def _symbolic_value (self , ty : Ty , mutable : bool ) -> tuple [KInner , Iterable [KInner ], KInner | None ]:
314314 # returns: symbolic value of given type, related constraints, related pointer metadata
315+
316+ no_metadata = KApply (
317+ 'Metadata' ,
318+ KApply ('noMetadataSize' , ()),
319+ token (0 ),
320+ KApply ('noMetadataSize' , ()),
321+ )
322+
315323 match self .types .get (ty ):
316324 case IntT (info ):
317325 val , constraints = int_var (self ._fresh_var ('ARG_INT' ), info .value , True )
@@ -359,7 +367,14 @@ def _symbolic_value(self, ty: Ty, mutable: bool) -> tuple[KInner, Iterable[KInne
359367 return (
360368 KApply ('Value::Range' , (elems ,)),
361369 [mlEqualsTrue (eqInt (KApply ('sizeList' , (elems ,)), l ))],
362- KApply ('dynamicSize' , (l ,)),
370+ KApply (
371+ 'Metadata' ,
372+ (
373+ KApply ('dynamicSize' , (l ,)),
374+ token (0 ),
375+ KApply ('dynamicSize' , (l ,)),
376+ ),
377+ ),
363378 )
364379
365380 case ArrayT (element_type , size ) if size is not None :
@@ -372,7 +387,14 @@ def _symbolic_value(self, ty: Ty, mutable: bool) -> tuple[KInner, Iterable[KInne
372387 return (
373388 KApply ('Value::Range' , (list_of (elem_vars ),)),
374389 elem_constraints ,
375- KApply ('staticSize' , (token (size ),)),
390+ KApply (
391+ 'Metadata' ,
392+ (
393+ KApply ('staticSize' , (token (size ),)),
394+ token (0 ),
395+ KApply ('staticSize' , (token (size ),)),
396+ ),
397+ ),
376398 )
377399
378400 case TupleT (components ):
@@ -397,10 +419,10 @@ def _symbolic_value(self, ty: Ty, mutable: bool) -> tuple[KInner, Iterable[KInne
397419 KApply (
398420 'Value::Reference' ,
399421 (
400- token (0 ),
422+ token (0 ), # Stack OFFSET field
401423 KApply ('place' , (KApply ('local' , (token (ref ),)), KApply ('ProjectionElems::empty' , ()))),
402424 KApply ('Mutability::Mut' , ()) if mutable else KApply ('Mutability::Not' , ()),
403- metadata if metadata is not None else KApply ( 'noMetadata' , ()) ,
425+ metadata if metadata is not None else no_metadata ,
404426 ),
405427 ),
406428 pointee_constraints ,
@@ -418,7 +440,7 @@ def _symbolic_value(self, ty: Ty, mutable: bool) -> tuple[KInner, Iterable[KInne
418440 token (0 ),
419441 KApply ('place' , (KApply ('local' , (token (ref ),)), KApply ('ProjectionElems::empty' , ()))),
420442 KApply ('Mutability::Mut' , ()) if mutable else KApply ('Mutability::Not' , ()),
421- KApply ( 'PtrEmulation' , ( metadata if metadata is not None else KApply ( 'noMetadata' , ()),)) ,
443+ metadata if metadata is not None else no_metadata ,
422444 ),
423445 ),
424446 pointee_constraints ,
@@ -479,7 +501,7 @@ class SimpleRes(NamedTuple):
479501
480502class ArrayRes (NamedTuple ):
481503 value : TypedValue
482- metadata : Metadata
504+ metadata : MetadataSize
483505
484506
485507class PointerRes (NamedTuple ):
0 commit comments