New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
static assert is failing on windows in PerlIO #16648
Comments
From @khwilliamsonThis is a bug report for perl from khw@khw-xps-8930.(none), In, for example, http://perl5.test-smoke.org/report/68458, we are getting scalar.xs: In function 'PerlIOScalar_read': The code in scalar.xs, is /* I assume that Off_t is at least as large as len (which all quoted lines are from commit 63d073d [perl #123443] avoid overflowing got into a negative number Flags: Site configuration information for perl 5.29.2 |
From @tonycozOn Fri, 03 Aug 2018 08:43:48 -0700, public@khwilliamson.com wrote:
The attached fixes it for me. Tony |
From @tonycoz133422-small-off_t.patchFrom bdac76d8b892a8d78b71020356f53ee203d66a32 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Wed, 8 Aug 2018 14:21:33 +1000
Subject: (perl #133422) handle Off_t smaller than size_t
---
ext/PerlIO-scalar/scalar.xs | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/ext/PerlIO-scalar/scalar.xs b/ext/PerlIO-scalar/scalar.xs
index 10a4185899..e717736fab 100644
--- a/ext/PerlIO-scalar/scalar.xs
+++ b/ext/PerlIO-scalar/scalar.xs
@@ -185,11 +185,20 @@ PerlIOScalar_read(pTHX_ PerlIO *f, void *vbuf, Size_t count)
/* I assume that Off_t is at least as large as len (which
* seems safe) and that the size of the buffer in our SV is
* always less than half the size of the address space
+ *
+ * Which turns out not to be the case on 64-bit Windows, since
+ * a build with USE_LARGE_FILES=undef defines Off_t as long,
+ * which is 32-bits on 64-bit Windows. This doesn't appear to
+ * be the case on other 64-bit platforms.
*/
- STATIC_ASSERT_STMT(sizeof(Off_t) >= sizeof(len));
+#if Off_t_size >= Size_t_size
assert(len < ((~(STRLEN)0) >> 1));
if ((Off_t)len <= s->posn)
return 0;
+#else
+ if (len <= (STRLEN)s->posn)
+ return 0;
+#endif
got = len - (STRLEN)(s->posn);
if ((STRLEN)got > (STRLEN)count)
got = (STRLEN)count;
--
2.11.0
From 3af0f3b7953b29c53ece75b9a22bdb3d47a4993a Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Wed, 8 Aug 2018 15:44:42 +1000
Subject: bump $PerlIO::scalar::VERSION
---
ext/PerlIO-scalar/scalar.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ext/PerlIO-scalar/scalar.pm b/ext/PerlIO-scalar/scalar.pm
index 61b62ea3a2..6f4fa176be 100644
--- a/ext/PerlIO-scalar/scalar.pm
+++ b/ext/PerlIO-scalar/scalar.pm
@@ -1,5 +1,5 @@
package PerlIO::scalar;
-our $VERSION = '0.29';
+our $VERSION = '0.30';
require XSLoader;
XSLoader::load();
1;
--
2.11.0
|
The RT System itself - Status changed from 'new' to 'open' |
From @khwilliamsonFixed by commit |
@khwilliamson - Status changed from 'open' to 'pending release' |
From @khwilliamsonOops, I should have said |
From [Unknown Contact. See original ticket]Oops, I should have said |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.30.0, this and 160 other issues have been Perl 5.30.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#133422 (status was 'resolved')
Searchable as RT133422$
The text was updated successfully, but these errors were encountered: