Skip to main content

compile_program_to_c_with_policy

Function compile_program_to_c_with_policy 

Source
pub fn compile_program_to_c_with_policy<'a>(
    prog: &'a CompiledProgram,
    policy_ctx: Option<(&'a Interner, &'a PolicyRegistry)>,
) -> Result<String, String>
Expand description

The Op-walker with an optional policy context — the (interner, PolicyRegistry) a CheckPolicy op needs to resolve its predicate/capability name into a condition (the bytecode carries only the name, exactly as the VM consults its policy_ctx). A program with no Check statement passes None and emits byte-identical C to before. This is the seam compile_to_c_via_bytecode uses so runtime authorization lowers natively.