pub enum ArgMemKind {
NonPtr,
MutPtr,
ConstPtr,
Opaque,
OutPtr,
}Expand description
The memory kind of one prototyped-external parameter, as seen by the RAM argmem model. An external can only touch memory we model through pointers we pass it (its own libc-internal state lives outside the lifted image), so each pointer parameter bounds a whole-object effect on the caller’s argument.
The variants are ordered so the analysis layer needs no C-type data of its own: it reads this per-input kind (kept in lockstep with the materialized register-interface inputs) plus the function-level variadic flag.
Variants§
NonPtr
A non-pointer scalar (integer/float): the external cannot reach any memory we model through it. No effect.
MutPtr
A mutable data pointer (char *, void *, struct S *): a whole-object
read+write effect on the addressed object — the callee may both read
the pre-call contents and clobber them (strcat’s dest, realloc). The
read half means a frame-local landing goes ⊤ (freshness), so such a
pointer is not memory-free-composable through an uninitialized local.
ConstPtr
A const-qualified data pointer (const char *): a whole-object read-only
effect on the addressed object.
Opaque
A pointer the shallow whole-object model cannot bound: a function/callback
pointer (re-enters our code — qsort’s comparator), or a pointer to
another pointer / an unmodeled pointee (a transitive write escapes the
addressed object). Its presence sends the whole external footprint to ⊤.
OutPtr
A write-only destination pointer (memset/memcpy dest): the callee
never reads the pre-call contents, only clobbers them. A pure whole-object
write, so a frame-local landing is contained (the memset(&local) fold).
Minted only for symbols the extern_argmem write-only table vouches for
(libc semantics guarantee the destination is never read before write).
Appended last on purpose: bincode encodes a fieldless enum by variant
index, so keeping NonPtr/MutPtr/ConstPtr/Opaque at their old
indices lets pre-OutPtr .harbinger snapshots still decode.
Trait Implementations§
Source§impl Clone for ArgMemKind
impl Clone for ArgMemKind
Source§fn clone(&self) -> ArgMemKind
fn clone(&self) -> ArgMemKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more