mirror of
https://github.com/ianlancetaylor/libbacktrace.git
synced 2026-04-01 15:09:06 +08:00
libbacktrace: update to current version from GCC trunk
This adds DWARF 5 support as well as an enhanced testsuite. Patch assembled by Than McIntosh.
This commit is contained in:
10
mmapio.c
10
mmapio.c
@@ -1,5 +1,5 @@
|
||||
/* mmapio.c -- File views using mmap.
|
||||
Copyright (C) 2012-2018 Free Software Foundation, Inc.
|
||||
Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Google.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -51,7 +51,7 @@ POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
int
|
||||
backtrace_get_view (struct backtrace_state *state ATTRIBUTE_UNUSED,
|
||||
int descriptor, off_t offset, size_t size,
|
||||
int descriptor, off_t offset, uint64_t size,
|
||||
backtrace_error_callback error_callback,
|
||||
void *data, struct backtrace_view *view)
|
||||
{
|
||||
@@ -60,6 +60,12 @@ backtrace_get_view (struct backtrace_state *state ATTRIBUTE_UNUSED,
|
||||
off_t pageoff;
|
||||
void *map;
|
||||
|
||||
if ((uint64_t) (size_t) size != size)
|
||||
{
|
||||
error_callback (data, "file size too large", 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pagesize = getpagesize ();
|
||||
inpage = offset % pagesize;
|
||||
pageoff = offset - inpage;
|
||||
|
||||
Reference in New Issue
Block a user