[ORC][ORC-RT] Make WrapperFunctionCall::Create support void functions.
Serialized calls to void-wrapper-functions should have zero bytes of argument data, but accessing ArgData[0] may (and will, in the case of SmallVector) fail if the argument data buffer is empty. This commit fixes the issue by adding a check for empty argument buffers.
This commit is contained in:
@@ -408,7 +408,8 @@ public:
|
||||
const ArgTs &...Args) {
|
||||
ArgDataBufferType ArgData;
|
||||
ArgData.resize(SPSSerializer::size(Args...));
|
||||
SPSOutputBuffer OB(&ArgData[0], ArgData.size());
|
||||
SPSOutputBuffer OB(ArgData.empty() ? nullptr : ArgData.data(),
|
||||
ArgData.size());
|
||||
if (SPSSerializer::serialize(OB, Args...))
|
||||
return WrapperFunctionCall(FnAddr, std::move(ArgData));
|
||||
return make_error<StringError>("Cannot serialize arguments for "
|
||||
|
||||
Reference in New Issue
Block a user