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
_______________________________________________
Libunwind-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to