[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [Patch] fix macro GET_MEMORY
From: |
David Lee |
Subject: |
[Libunwind-devel] [Patch] fix macro GET_MEMORY |
Date: |
Tue, 28 Dec 2010 14:31:07 +0800 |
Hi, list
Here below is a small patch which fixes the macro `GET_MEMORY()'.
The macro body used `size' instead of `size_in_bytes' which causes the
macro refers to a variable named `size' in the outer scope.
-----------------------------<begin>-----------------------------
--- a/include/libunwind_i.h
+++ b/include/libunwind_i.h
@@ -214,8 +214,8 @@ do { \
#define GET_MEMORY(mem, size_in_bytes) \
do { \
/* Hopefully, mmap() goes straight through to a system call stub... */ \
- mem = mmap (0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, \
- -1, 0); \
+ mem = mmap (0, size_in_bytes, PROT_READ | PROT_WRITE,
\
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); \
if (mem == MAP_FAILED) \
mem = NULL;
\
} while (0)
------------------------------<end>------------------------------
--
Thanks,
Li Qun
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Libunwind-devel] [Patch] fix macro GET_MEMORY,
David Lee <=