The calling convention is: [RVO pointer] [instance pointer] [... args ...] We handle the instance pointer ourselves, BUT for the RVO pointer, we just assumed in visitReturnStmt() that it is on top of the stack. Which isn't true if there are other args present (and a this pointer, maybe). Fix this by recording the RVO pointer explicitly when creating an InterpFrame, just like we do with the instance/This pointer. There is already a "RVOAndParams()" test in test/AST/Inter/records.cpp, that was supposed to test this, however, it didn't trigger any problematic behavior because the parameter and the return value have the same type.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo