[llvm] d6c9b3c - [ORC] Relax assertions in SimpleRemoteEPCTransport.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 9 21:58:25 PDT 2022
Author: Lang Hames
Date: 2022-10-09T21:58:10-07:00
New Revision: d6c9b3cc340bbe6f79f9ede571daf7e52a307a38
URL: https://github.com/llvm/llvm-project/commit/d6c9b3cc340bbe6f79f9ede571daf7e52a307a38
DIFF: https://github.com/llvm/llvm-project/commit/d6c9b3cc340bbe6f79f9ede571daf7e52a307a38.diff
LOG: [ORC] Relax assertions in SimpleRemoteEPCTransport.
Null source/destination pointers are ok for zero-sized messages.
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.cpp b/llvm/lib/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.cpp
index 2bb204e688fc5..921ac47d421db 100644
--- a/llvm/lib/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.cpp
@@ -137,7 +137,7 @@ static Error makeUnexpectedEOFError() {
Error FDSimpleRemoteEPCTransport::readBytes(char *Dst, size_t Size,
bool *IsEOF) {
- assert(Dst && "Attempt to read into null.");
+ assert((Size == 0 || Dst) && "Attempt to read into null.");
ssize_t Completed = 0;
while (Completed < static_cast<ssize_t>(Size)) {
ssize_t Read = ::read(InFD, Dst + Completed, Size - Completed);
@@ -167,7 +167,7 @@ Error FDSimpleRemoteEPCTransport::readBytes(char *Dst, size_t Size,
}
int FDSimpleRemoteEPCTransport::writeBytes(const char *Src, size_t Size) {
- assert(Src && "Attempt to append from null.");
+ assert((Size == 0 || Src) && "Attempt to append from null.");
ssize_t Completed = 0;
while (Completed < static_cast<ssize_t>(Size)) {
ssize_t Written = ::write(OutFD, Src + Completed, Size - Completed);
More information about the llvm-commits
mailing list