Skip to content

Commit

Permalink
Resolve constexpr related link error in debug mode (apache#4641)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen authored and zhiics committed Mar 2, 2020
1 parent 7d66172 commit ce98717
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/runtime/micro/tcl_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ void TclSocket::Connect(tvm::common::SockAddr addr) {
}

void TclSocket::SendCommand() {
cmd_builder_ << kCommandTerminateToken;
const char terminate_token = kCommandTerminateToken;
cmd_builder_ << terminate_token;
std::string full_cmd = cmd_builder_.str();
CHECK(tcp_socket_.Send(full_cmd.data(), full_cmd.length()) != -1)
<< "failed to send command";
Expand All @@ -63,9 +64,9 @@ void TclSocket::SendCommand() {
last_read = reply_buf_[bytes_read - 1];
} while (bytes_read == kReplyBufSize - 1);
CHECK(bytes_read != -1) << "failed to read command reply";
} while (last_read != kCommandTerminateToken);
} while (last_read != terminate_token);
last_reply_ = reply_builder_.str();
CHECK_EQ(last_reply_[last_reply_.length()-1], kCommandTerminateToken)
CHECK_EQ(last_reply_[last_reply_.length()-1], terminate_token)
<< "missing command terminator";
}

Expand Down

0 comments on commit ce98717

Please sign in to comment.