From: lvasiliev <lvasiliev@tarantool.org> To: v.shpilevoy@tarantool.org Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH V3 7/7] error: add error MsgPack encoding Date: Wed, 15 Apr 2020 18:08:24 +0300 [thread overview] Message-ID: <1932003c-5148-8129-28e5-b39885e4df2c@tarantool.org> (raw) In-Reply-To: <fb22bb10a83fb954ccc33aa74ec655d7529619f7.1586934134.git.lvasiliev@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);
prev parent reply other threads:[~2020-04-15 15:08 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-15 9:31 [Tarantool-patches] [PATCH V3 0/7] Extending error functionality Leonid Vasiliev 2020-04-15 9:31 ` [Tarantool-patches] [PATCH V3 1/7] error: add a Lua traceback to error Leonid Vasiliev 2020-04-15 9:31 ` [Tarantool-patches] [PATCH V3 2/7] error: add custom error type Leonid Vasiliev 2020-04-15 9:31 ` [Tarantool-patches] [PATCH V3 3/7] error: send custom type in IProto Leonid Vasiliev 2020-04-15 9:31 ` [Tarantool-patches] [PATCH V3 4/7] session: add offset to SQL session settings array Leonid Vasiliev 2020-04-15 9:32 ` [Tarantool-patches] [PATCH V3 5/7] error: add session setting for error type marshaling Leonid Vasiliev 2020-04-15 9:32 ` [Tarantool-patches] [PATCH V3 6/7] error: update constructors of some errors Leonid Vasiliev 2020-04-15 9:32 ` [Tarantool-patches] [PATCH V3 7/7] error: add error MsgPack encoding Leonid Vasiliev 2020-04-15 15:08 ` lvasiliev [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1932003c-5148-8129-28e5-b39885e4df2c@tarantool.org \ --to=lvasiliev@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH V3 7/7] error: add error MsgPack encoding' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox