This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix gmtime() and localtime() so they can pop times larger than 2**55 off the stack...
authorMichael G. Schwern <schwern@pobox.com>
Fri, 3 Oct 2008 20:05:10 +0000 (16:05 -0400)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sat, 3 Jan 2009 17:39:09 +0000 (18:39 +0100)
commit8efababc2f87779325166ff9fd8b47cde3763a95
tree3c3ec29b9e68f8946dffed0ef23482e7a88a4da4
parent0fb7f756cb6b1af5b0111c6cebcd5337b7ebd402
Fix gmtime() and localtime() so they can pop times larger than 2**55 off the stack. Neither POPn nor SvNVx work when casted to (Time64_T). Had to use a double and then cast.

Also POPq uses an SvIV so that's no good.

This causes an unfortunate loss in accuracy near 2**63 up to 8 minutes.

%lld is broken, it uses regular integers.  Need to use doubles and %.0f
instead, again losing accuracy.

Now things can go out to 2**63-512.
pp_sys.c