Files
clang-p2996/llvm/test/CodeGen/WebAssembly/externref-globalget.ll
Heejin Ahn 5c92f2331c [WebAssembly] Fix MIR printing of reference types (#113028)
When printing a memory operand in MIR, this line

d37bc32a65/llvm/lib/CodeGen/MachineOperand.cpp (L1247)
calls this
d37bc32a65/llvm/include/llvm/Support/Alignment.h (L238)
which assumes `Rhs` (the size in this case) is positive.

But Wasm reference types' size is set to 0:
d37bc32a65/llvm/include/llvm/CodeGen/ValueTypes.td (L326-L328)

`getSize() > 0` condition was added with the Wasm reference types
support in
46667a1003,
and it looks it was removed in #84751. This revives the condition so
that Wasm reference types will not crash the MIR printer.
2024-10-22 13:48:00 -07:00

885 B