Skip to content

Commit

Permalink
fuzzgen: Add stack map variables (#8941)
Browse files Browse the repository at this point in the history
  • Loading branch information
afonso360 authored Jul 25, 2024
1 parent 6f41aed commit 5d0d616
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cranelift/fuzzgen/src/function_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1898,6 +1898,14 @@ where
let var = Variable::new(id);
builder.declare_var(var, ty);
builder.def_var(var, value);

// Randomly declare variables as needing a stack map.
// We limit these to only types that have fewer than 16 bytes
// since the stack map mechanism does not support larger types.
if ty.bytes() <= 16 && self.u.arbitrary()? {
builder.declare_var_needs_stack_map(var);
}

self.resources
.vars
.entry(ty)
Expand Down

0 comments on commit 5d0d616

Please sign in to comment.