Avoid complex designated initializer, initialize internal struct padding

The former is to fix compilation on GCC 7, the latter to satisfy MSAN.

PiperOrigin-RevId: 355114355
Change-Id: I5c89a65df16fe9338bcfa24b2e48c246d240ce62
pull/83/head
Christian Blichmann 2021-02-02 00:56:30 -08:00 committed by Copybara-Service
parent 55a8373ec3
commit 1840083919
2 changed files with 4 additions and 8 deletions

View File

@ -78,14 +78,14 @@ struct FuncCall {
struct FuncRet {
// Return type:
v::Type ret_type = v::Type::kVoid;
v::Type ret_type;
// Return value.
union {
uintptr_t int_val = 0;
uintptr_t int_val;
long double float_val;
};
// Status of the operation: success/failure.
bool success = false;
bool success;
};
} // namespace sapi

View File

@ -340,11 +340,7 @@ void ServeRequest(sandbox2::Comms* comms) {
CHECK(comms->RecvTLV(&tag, &bytes));
FuncRet ret = {
.ret_type = v::Type::kVoid,
.int_val = static_cast<uintptr_t>(Error::kUnset),
.success = false,
};
FuncRet ret{}; // Brace-init zeroes struct padding
switch (tag) {
case comms::kMsgCall: