Skip to content

Commit

Permalink
fuzzgen: Add stack map variables
Browse files Browse the repository at this point in the history
  • Loading branch information
afonso360 committed Jul 13, 2024
1 parent 225d20e commit 635ea57
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 @@ -1892,6 +1892,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 635ea57

Please sign in to comment.