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
Oleg Nesterov
July 4, 2012 06:47
[perl #113980] [PATCH] pp_syscall: "I32 retval" truncates the returned value
Message ID:
# New Ticket Created by  Oleg Nesterov 
# Please include the string:  [perl #113980]
# in the subject line of all future correspondence about this issue. 
# <URL: >


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 ;)


--- 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About