Skip to content

spirv-fuzz: TransformationAddParameter has instroduced a regression #3480

@Vasniktel

Description

@Vasniktel

if (ir_context->get_def_use_mgr()->NumUsers(old_function_type) == 1) {
// Adjust existing function type if it is used only by this function.
old_function_type->AddOperand({SPV_OPERAND_TYPE_ID, {parameter_type_id}});

parameter_type_id might have been created after old_function_type. This piece of code will then make old_function_type reference id of an instruction that is defined below the old_function_type which causes a segmentation fault in the type manager.

There is a bigger concern here, though. If this behaviour is invalid, then the validator should've raised an error. If it is valid, then the type manager shouldn't have caused a segmentation fault. Either way, segfault should've never occurred.

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