You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Short Version
This PR:
- Threads `Span`s through to `#setUpCalleeData` instead of being ignored
from the `Terminator`
- Modifies the python utility code that prints leaves for `kmir show
--leaves` to print function, call site, and error messages when possible
for `panic` and `assert_failed`
- Adds the ability to truncate a path for testing so CI is deterministic
### Long Version
In the event that a `panic` or `assert_failed` is reached in a proof, a
stuck leaf node will be present in the KCFG that calls `** UNKNOWN
FUNCTION **`. It is not clear exactly which function is being called,
where this is being called from, or what the error message is (if there
is one) as all the information is represented as interned data (`DefId`,
`Span`, `AllocId`).
The print out of the failing nodes is improved for `kmir show --leaves`
from:
```
Node 3:
#setUpCalleeData ( monoItemFn ( ... name: symbol ( "** UNKNOWN FUNCTION **" ) , id: defId ( 38 ) , body: noBody ) , operandConstant ( constOperand ( ... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst ( ... kind: constantKindAllocated ( allocation ( ... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap ( ... ptrs: provenanceMapEntry ( ... offset: 0 , allocId: allocId ( 1 ) ) .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 39 ) , id: mirConstId ( 25 ) ) ) ) .Operands) ~> .K
```
to:
```
Node 3:
#setUpCalleeData ( monoItemFn ( ... name: symbol ( "** UNKNOWN FUNCTION **" ) , id: defId ( 38 ) , body: noBody ) , operandConstant ( constOperand ( ... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst ( ... kind: constantKindAllocated ( allocation ( ... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap ( ... ptrs: provenanceMapEntry ( ... offset: 0 , allocId: allocId ( 1 ) ) .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 39 ) , id: mirConstId ( 25 ) ) ) ) .Operands , span ( 117 ) ) ~> .K
>> function: core::panicking::panic::h941160ead03e2d54
>> call span: /home/daniel/Applications/mir-semantics/kmir/src/tests/integration/data/prove-rs/symbolic-args-fail.rs:53:5
>> message: 'assertion failed: false'
```
This is achieved by taking advantage of the deterministic location of
the interned values, retrieving those values, and then consulting the
`.smir.json` to get the un-interned data associated with those interned
values.
@@ -357,12 +357,13 @@ The local data has to be set up for the call, which requires information about t
357
357
An operand may be a `Reference` (the only way a function could access another function call's `local` variables). For this case, the stack height in the `Reference` must be incremented because a stack frame is added.
0 commit comments