Skip to content

spirv-fuzz: Back up pointer, write through pointer, restore #3624

@afd

Description

@afd

Add a transformation (and associated fuzzer pass) that takes:

  • An existing pointer in the module
  • A fresh id for a temporary result

and:

  • Backs up the current value that the pointer refers to by loading from the pointer into the temporary result
  • Stores an irrelevant zero to the pointer (so that another fuzzer pass can make this more interesting)
  • Restores the pointer's original value from the temporary result.

E.g., if p is the existing pointer we might do:

%temporary_result = OpLoad p
OpStore %p %irrelevant_zero
OpStore %p %temporary_result

Other fuzzer passes should be encouraged to replace the irrelevant zero with something interesting, and wrap the restoring OpStore in some control flow to make it less clear that it will be executed.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions