[Tarantool-patches] [PATCH V3 7/7] error: add error MsgPack encoding
lvasiliev
lvasiliev at tarantool.org
Wed Apr 15 18:08:24 MSK 2020
Fix release builds.
diff --git a/src/box/lua/mp_error.cc b/src/box/lua/mp_error.cc
index f99ed2e..8504fba 100644
--- a/src/box/lua/mp_error.cc
+++ b/src/box/lua/mp_error.cc
@@ -95,6 +95,9 @@ struct mp_error {
static void
mp_error_init(struct mp_error *mp_error)
{
+ mp_error->error_code = 0;
+ mp_error->line = 0;
+ mp_error->saved_errno = 0;
mp_error->error_type = MP_ERROR_TYPE_UNKNOWN;
mp_error->file = NULL;
mp_error->traceback = NULL;
@@ -165,7 +168,7 @@ error_to_mpstream(struct error *error, struct
mpstream *stream)
{
uint8_t err_type = mp_error_type_from_str(box_error_type(error));
- uint32_t errcode;
+ uint32_t errcode = 0;
const char *custom_type = NULL;
const char *ad_obj_type = NULL;
const char *ad_obj_name = NULL;
@@ -371,7 +374,7 @@ build_error(struct mp_error *mp_error)
struct error *
error_unpack(const char **data, uint32_t len)
{
- const char *svp = *data;
+ const char *end = *data + len;
if (mp_typeof(**data) != MP_MAP) {
diag_set(ClientError, ER_INVALID_MSGPACK,
"Invalid MP_ERROR format");
@@ -463,7 +466,8 @@ error_unpack(const char **data, uint32_t len)
}
}
- assert(*data == svp + len);
+ (void)end;
+ assert(*data == end);
err = build_error(&mp_err);
mp_error_cleanup(&mp_err);
More information about the Tarantool-patches
mailing list