MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / insert_stack_store

Function insert_stack_store

cranelift/fuzzgen/src/function_generator.rs:152–177  ·  view source on GitHub ↗
(
    fgen: &mut FunctionGenerator,
    builder: &mut FunctionBuilder,
    _opcode: Opcode,
    args: &[Type],
    _rets: &[Type],
)

Source from the content-addressed store, hash-verified

150}
151
152fn insert_stack_store(
153 fgen: &mut FunctionGenerator,
154 builder: &mut FunctionBuilder,
155 _opcode: Opcode,
156 args: &[Type],
157 _rets: &[Type],
158) -> Result<()> {
159 let typevar = args[0];
160 let type_size = typevar.bytes();
161
162 let (slot, slot_size, _align, category) = fgen.stack_slot_with_size(type_size)?;
163
164 // `stack_store` doesn't support setting MemFlagsData, and it does not set any
165 // alias analysis bits, so we can only emit it for `Other` slots.
166 if category != AACategory::Other {
167 return Err(arbitrary::Error::IncorrectFormat.into());
168 }
169
170 let offset = fgen.u.int_in_range(0..=(slot_size - type_size))? as i32;
171
172 let arg0 = fgen.get_variable_of_type(typevar)?;
173 let arg0 = builder.use_var(arg0);
174
175 builder.ins().stack_store(arg0, slot, offset);
176 Ok(())
177}
178
179fn insert_cmp(
180 fgen: &mut FunctionGenerator,

Callers

nothing calls this directly

Calls 6

OkFunction · 0.85
stack_slot_with_sizeMethod · 0.80
get_variable_of_typeMethod · 0.80
bytesMethod · 0.45
use_varMethod · 0.45
insMethod · 0.45

Tested by

no test coverage detected