292b33
From f9344c91a4ca48288bba30dc94a2d712d0659670 Mon Sep 17 00:00:00 2001
292b33
From: Oleg Nesterov <oleg@redhat.com>
292b33
Date: Wed, 4 Jul 2012 08:21:15 -0700
292b33
Subject: [PATCH] [perl #113980] pp_syscall: "I32 retval" truncates the
292b33
 returned value
292b33
292b33
I noticed today that syscall(9, ...) (mmap) doesn't work for me.
292b33
292b33
The problem is obvious, pp_syscall() uses I32 for retval and the
292b33
"long" address doesn't fit into "int".
292b33
292b33
The one-liner below should fix the problem.
292b33
---
292b33
 pp_sys.c | 2 +-
292b33
 1 file changed, 1 insertion(+), 1 deletion(-)
292b33
292b33
diff --git a/pp_sys.c b/pp_sys.c
292b33
index fb93732..c5d63ac 100644
292b33
--- a/pp_sys.c
292b33
+++ b/pp_sys.c
292b33
@@ -5456,7 +5456,7 @@ PP(pp_syscall)
292b33
     register I32 items = SP - MARK;
292b33
     unsigned long a[20];
292b33
     register I32 i = 0;
292b33
-    I32 retval = -1;
292b33
+    IV retval = -1;
292b33
 
292b33
     if (PL_tainting) {
292b33
 	while (++MARK <= SP) {
292b33
-- 
292b33
1.7.11.4
292b33