summaryrefslogtreecommitdiff
path: root/mysys/stacktrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/stacktrace.c')
-rw-r--r--mysys/stacktrace.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c
index ed3a15ae27e..48cdaaa6c91 100644
--- a/mysys/stacktrace.c
+++ b/mysys/stacktrace.c
@@ -84,8 +84,11 @@ static int safe_print_str(const char *addr, int max_len)
if ((fd= open(buf, O_RDONLY)) < 0)
return -1;
+ /* Ensure that off_t can hold a pointer. */
+ compile_time_assert(sizeof(off_t) >= sizeof(intptr));
+
total= max_len;
- offset= (off_t) addr;
+ offset= (intptr) addr;
/* Read up to the maximum number of bytes. */
while (total)