Skip to content

spriv-fuzz: Refactor variable creation into a separate function(s) #3413

@Vasniktel

Description

@Vasniktel

We have two transformations that create new variables in the module - TransformationAddGlobalVariable and TransformationAddLocalVariable. Some transformations also require that 'irrelevant' variables are present in the module (e.g. TransformationPushIdThroughVariable and TransformationAddCopyMemory).
We could create a new variable in the fuzzer pass and check that it's irrelevant in the transformation's IsApplicable method but other transformations might clobber the value of the variable in this case. Thus, we are simply reusing the same code inside TransformationPushIdThroughVariable and TransformationAddCopyMemory. It would be good to refactor it into a separate function(s) (say, in fuzzerutil) to reduce the boilerplate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions