Skip to content

[WASM] LowerAccessVectorElement tries to cast undef to ConstantSDNode and crashes during casting #61828

@DataCorrupted

Description

@DataCorrupted

Reproduction: https://godbolt.org/z/PqK6Y1oa6

define <4 x float> @foo(i64 %i0, i64 %i1, ptr %p) {
  %B4 = urem i64 %i0, %i0
  %B5 = udiv i64 %i1, %B4
  %I = insertelement <4 x float> <float 0.25, float 0.25, float 0.25, float 0.25>, float 0.5, i64 %B5
  ret <4 x float>  %I
}

Cause:

In WebAssemblyISelLowering.cpp:2244, the UndefValue is also casted into ConstantSDNode, which causes the crash.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions