develooper Front page | perl.perl5.porters | Postings from July 2012

[perl #113980] [PATCH] pp_syscall: "I32 retval" truncates the returned value

Thread Previous | Thread Next
From:
Oleg Nesterov
Date:
July 4, 2012 06:47
Subject:
[perl #113980] [PATCH] pp_syscall: "I32 retval" truncates the returned value
Message ID:
rt-3.6.HEAD-28836-1341406565-1574.113980-75-0@perl.org
# New Ticket Created by  Oleg Nesterov 
# Please include the string:  [perl #113980]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=113980 >


Hello,

I noticed today that syscall(9, ...) (mmap) doesn't work for me.

The problem is obvious, pp_syscall() uses I32 for retval and the
"long" address doesn't fit into "int".

The one-liner below should fix the problem. I am not sure where
should I send this patch, how should I write the changelog, etc.
IOW, sorry if my email doesn't conform the rules.

And btw, thanks to all perl developers for perl ;)

Oleg.

--- a/pp_sys.c
+++ b/pp_sys.c
@@ -5456,7 +5456,7 @@ PP(pp_syscall)
     register I32 items = SP - MARK;
     unsigned long a[20];
     register I32 i = 0;
-    I32 retval = -1;
+    IV retval = -1;
 
     if (PL_tainting) {
 	while (++MARK <= SP) {


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About