The currently implementation of funcrefs is broken since it is putting
the funcref itself on the stack before the call_indirect. Instead what
should be on the stack is the constant 0, which is the index at which
we store the funcref in __funcref_call_table.
Details
Details
- Reviewers
tlively - Commits
- rG0c7495848a02: [WebAssembly] Fix call_indirect on funcrefs
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | ||
---|---|---|
571 | Sure. | |
578 | I don't think so. You cannot create MachineOperands from scratch. The only reason we can use the addOperand before is because we did not build the operand FnPtr, we extracted it. MachineOperands are built as part of the MachineInstrBuilder, which is what I used. |
It would be good to add a comment about why we are adding this zero operand here.