Skip to main content

patch_seq_push_string

Function patch_seq_push_string 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn patch_seq_push_string( stack: Stack, c_str: *const i8, ) -> Stack
Expand description

Push a C string literal onto the stack (for compiler-generated code).

Used by codegen paths whose source is always an ASCII identifier (variant tag comparisons, NULL-FFI fallbacks, etc.) โ€” they have no embedded NULs, so the C-string convention is fine. Byte-clean string literals go through patch_seq_push_string_bytes instead.

In debug builds, this asserts the input is ASCII to catch a future codegen path that accidentally routes binary data here. In release the bytes are taken as-is โ€” the comment above is the contract.

Stack effect: ( โ€“ str )

ยงSafety

The c_str pointer must be valid and null-terminated