From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 402DC4696C3 for ; Wed, 15 Apr 2020 18:08:25 +0300 (MSK) References: From: lvasiliev Message-ID: <1932003c-5148-8129-28e5-b39885e4df2c@tarantool.org> Date: Wed, 15 Apr 2020 18:08:24 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH V3 7/7] error: add error MsgPack encoding List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: v.shpilevoy@tarantool.org Cc: tarantool-patches@dev.tarantool.org 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);