From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Serge Petrenko Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_22DDEFA8-6FCD-4EEE-8729-F82AA19E0397" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH v2 3/8] lua/pickle: fix a typo Date: Wed, 14 Aug 2019 14:15:57 +0300 In-Reply-To: <20190814111223.GE13834@esperanza> References: <20190814111223.GE13834@esperanza> To: Vladimir Davydov Cc: tarantool-patches@freelists.org, Konstantin Osipov List-ID: --Apple-Mail=_22DDEFA8-6FCD-4EEE-8729-F82AA19E0397 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > 14 =D0=B0=D0=B2=D0=B3. 2019 =D0=B3., =D0=B2 14:12, Vladimir Davydov = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0= ): >=20 > On Thu, Aug 08, 2019 at 02:55:54PM +0300, Serge Petrenko wrote: >> --- >> src/lua/pickle.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >>=20 >> diff --git a/src/lua/pickle.c b/src/lua/pickle.c >> index e47ac11b4..65208b5b3 100644 >> --- a/src/lua/pickle.c >> +++ b/src/lua/pickle.c >> @@ -109,14 +109,14 @@ lbox_pack(struct lua_State *L) >> case 'I': >> case 'i': >> /* signed and unsigned 32-bit integers */ >> - if (field.type !=3D MP_UINT && field.ival !=3D = MP_INT) >> + if (field.type !=3D MP_UINT && field.type !=3D = MP_INT) >> luaL_error(L, "pickle.pack: expected = 32-bit int"); >>=20 >> luaL_region_dup(L, buf, &field.ival, = sizeof(uint32_t)); >> break; >> case 'N': >> /* signed and unsigned 32-bit big endian = integers */ >> - if (field.type !=3D MP_UINT && field.ival !=3D = MP_INT) >> + if (field.type !=3D MP_UINT && field.type !=3D = MP_INT) >> luaL_error(L, "pickle.pack: expected = 32-bit int"); >>=20 >> field.ival =3D htonl(field.ival); >=20 > I assume this is a bug and so this patch should be pushed to all > maintained branches, right? Yep >=20 > Could you please add a test for this issue? No problem -- Serge Petrenko sergepetrenko@tarantool.org --Apple-Mail=_22DDEFA8-6FCD-4EEE-8729-F82AA19E0397 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

14 =D0=B0=D0=B2=D0=B3. 2019 =D0=B3., =D0=B2 = 14:12, Vladimir Davydov <vdavydov.dev@gmail.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0= =B0=D0=BB(=D0=B0):

On Thu, Aug = 08, 2019 at 02:55:54PM +0300, Serge Petrenko wrote:
---
src/lua/pickle.c | 4 ++--
1 file changed, 2 = insertions(+), 2 deletions(-)

diff --git = a/src/lua/pickle.c b/src/lua/pickle.c
index = e47ac11b4..65208b5b3 100644
--- a/src/lua/pickle.c
+++ b/src/lua/pickle.c
@@ -109,14 +109,14 @@ = lbox_pack(struct lua_State *L)
case = 'I':
case 'i':
/* signed and unsigned 32-bit = integers */
- if (field.type !=3D MP_UINT = && field.ival !=3D MP_INT)
+ if = (field.type !=3D MP_UINT && field.type !=3D MP_INT)
= = = = luaL_error(L, "pickle.pack: expected 32-bit int");

luaL_region_dup(L, buf, = &field.ival, sizeof(uint32_t));
break;
= = case 'N':
/* signed and unsigned 32-bit big = endian integers */
- if (field.type !=3D MP_UINT = && field.ival !=3D MP_INT)
+ if = (field.type !=3D MP_UINT && field.type !=3D MP_INT)
= = = = luaL_error(L, "pickle.pack: expected 32-bit int");

field.ival =3D = htonl(field.ival);

I assume this is a bug and so this patch should be pushed to = all
maintained = branches, right?

Yep


Could you please add a test for this = issue?

No = problem

= --Apple-Mail=_22DDEFA8-6FCD-4EEE-8729-F82AA19E0397--