From 6981234736b10631fc79ffe59933ee3a009c0cc2 Mon Sep 17 00:00:00 2001 From: gfx Date: Wed, 15 Sep 2010 13:09:14 +0900 Subject: [PATCH] Fix a possible mis-unpack on int64 --- perl/xs-src/unpack.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/perl/xs-src/unpack.c b/perl/xs-src/unpack.c index 108f9fda..4d4e965c 100644 --- a/perl/xs-src/unpack.c +++ b/perl/xs-src/unpack.c @@ -111,7 +111,11 @@ STATIC_INLINE int template_callback_int32(unpack_user* u PERL_UNUSED_DECL, int32 STATIC_INLINE int template_callback_int64(unpack_user* u PERL_UNUSED_DECL, int64_t d, SV** o) { dTHX; +#if IVSIZE==4 + *o = sv_2mortal(newSVnv(d)); +#else *o = sv_2mortal(newSViv(d)); +#endif return 0; }