Skip to content

Handle IR insertion errors gracefully #72

@dergoegge

Description

@dergoegge

When adding new generators or changing the IR in some way we've seen bugs that break the assumptions certain generators make.

All the generators have code similar to:

builder
    .append(Instruction {
        inputs: vec![some_var.index, some_other_var.index],
        operation: Operation::XYZ,
    })
    .expect("Inserting XYZ should always succeed");

That is, they assume that they'll be able to insert some instruction into the program based on their assumption and if they can't we panic.

We should extend GeneratorError with e.g. a FailedInsertion type, such that we can catch and handle these errors gracefully. Additionally the error could carry useful information to debug the issue, as it very likely indicates a bug in the fuzzer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions