Skip to content

spirv-fuzz: ReplaceIrrelevantId can introduce undefined behaviour #3980

@Vasniktel

Description

@Vasniktel

An index operand in OpAccessChain can be irrelevant. Thus, TransformationReplaceIrrelevantId can replace it with some other value. However, the new value may no longer be a valid index into the pointer if the latter points to array, matrix or vector. This causes assertion failures in spirv-opt that look like this:

error: line 32: Array access is out of bounds, array size is 8, but access index is 9
  %937 = OpCompositeExtract %float %951 9 0

Here, OpAccessChain was replaced with OpCompositeExtract in convert-local-access-chains pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions