This allows Callee::UnknownDef calls if they are direct (i.e. not a fn ptr), call a foreign fn (i.e. from an extern block), and are a KnownFn (i.e. returned by const fn all_known_fns). They are treated as normal local fn calls (i.e. they use .visit_local_call, like for Callee::LocalDef) as the PointerIds from the LFnSigs for these foreign fns are constrained by the PermissionSets annotated in the KnownFns. Note that these LFnSigs for the foreign fns are already created by fn gather_foreign_sigs.
I've included a test that checks that a call to libc's access succeeds without crashing and that the pointer passed to it is successfully inferred to be READ | OFFSET_ADD from access's known ptr perms, and thus intended to be rewritten as a slice (though it's not actually rewritten since the foreign fn call is FIXED).
This allows
Callee::UnknownDef
calls if they are direct (i.e. not afn
ptr), call a foreignfn
(i.e. from anextern
block), and are aKnownFn
(i.e. returned byconst fn all_known_fns
). They are treated as normal localfn
calls (i.e. they use.visit_local_call
, like forCallee::LocalDef
) as thePointerId
s from theLFnSig
s for these foreignfn
s are constrained by thePermissionSet
s annotated in theKnownFn
s. Note that theseLFnSig
s for the foreignfn
s are already created byfn gather_foreign_sigs
.I've included a test that checks that a call to
libc
'saccess
succeeds without crashing and that the pointer passed to it is successfully inferred to beREAD | OFFSET_ADD
fromaccess
's known ptr perms, and thus intended to be rewritten as a slice (though it's not actually rewritten since the foreignfn
call isFIXED
).