Skip to content
REFERENCE

use-after-move

Default severity: error · Identifier: weavec::use-after-move

A pointer is used after being passed to a WEAVEC_OWNED parameter, to realloc, or to a function that moves it (on every path, or on the paths whose result the caller has not ruled out; RFC 0006). Note: moved here.

Stop using the old owning pointer after transfer. Borrow the object when the callee only needs temporary access, or use a new value returned by the operation. With realloc, distinguish success from failure and avoid keeping aliases into the old storage after successful growth.

Diagnostic controls · Checked guarantees