mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
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
This commit is contained in:
parent
55a8373ec3
commit
1840083919
|
@ -78,14 +78,14 @@ struct FuncCall {
|
||||||
|
|
||||||
struct FuncRet {
|
struct FuncRet {
|
||||||
// Return type:
|
// Return type:
|
||||||
v::Type ret_type = v::Type::kVoid;
|
v::Type ret_type;
|
||||||
// Return value.
|
// Return value.
|
||||||
union {
|
union {
|
||||||
uintptr_t int_val = 0;
|
uintptr_t int_val;
|
||||||
long double float_val;
|
long double float_val;
|
||||||
};
|
};
|
||||||
// Status of the operation: success/failure.
|
// Status of the operation: success/failure.
|
||||||
bool success = false;
|
bool success;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sapi
|
} // namespace sapi
|
||||||
|
|
|
@ -340,11 +340,7 @@ void ServeRequest(sandbox2::Comms* comms) {
|
||||||
|
|
||||||
CHECK(comms->RecvTLV(&tag, &bytes));
|
CHECK(comms->RecvTLV(&tag, &bytes));
|
||||||
|
|
||||||
FuncRet ret = {
|
FuncRet ret{}; // Brace-init zeroes struct padding
|
||||||
.ret_type = v::Type::kVoid,
|
|
||||||
.int_val = static_cast<uintptr_t>(Error::kUnset),
|
|
||||||
.success = false,
|
|
||||||
};
|
|
||||||
|
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case comms::kMsgCall:
|
case comms::kMsgCall:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user