diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-01-01 15:54:43 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-01-01 15:55:17 -0800 |
commit | fb6812714fab0e7963ea9def9f33524ba993e22a (patch) | |
tree | 81c42cc2f5ab69bee11c21a60d5fda0cad21d488 /lib/canonicalize-lgpl.c | |
parent | 005cf69fe9cb3d1fb9a27b3dc7b8333c78bbddf9 (diff) | |
download | gnulib-fb6812714fab0e7963ea9def9f33524ba993e22a.tar.gz |
canonicalize: remove NARROW_ADDRESSES optimization
* lib/canonicalize-lgpl.c, lib/canonicalize.c (NARROW_ADDRESSES):
Remove, and remove all uses, as the optimization is arguably not
worth the extra complexity. Suggested by Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2020-December/121203.html
Diffstat (limited to 'lib/canonicalize-lgpl.c')
-rw-r--r-- | lib/canonicalize-lgpl.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c index 560e24288f..698f9ede25 100644 --- a/lib/canonicalize-lgpl.c +++ b/lib/canonicalize-lgpl.c @@ -85,10 +85,6 @@ # define IF_LINT(Code) /* empty */ #endif -/* True if adding two valid object sizes might overflow idx_t. - As a practical matter, this cannot happen on 64-bit machines. */ -enum { NARROW_ADDRESSES = IDX_MAX >> 31 >> 31 == 0 }; - #ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT # define DOUBLE_SLASH_IS_DISTINCT_ROOT false #endif @@ -343,7 +339,7 @@ realpath_stk (const char *name, char *resolved, if (end_in_extra_buffer) end_idx = end - extra_buf; size_t len = strlen (end); - if (NARROW_ADDRESSES && INT_ADD_OVERFLOW (len, n)) + if (INT_ADD_OVERFLOW (len, n)) { __set_errno (ENOMEM); goto error_nomem; |