diff options
author | markus@chromium.org <markus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-24 02:05:16 +0000 |
---|---|---|
committer | markus@chromium.org <markus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-24 02:05:16 +0000 |
commit | cdf209a4e1c621045cea90a3f4da6f21fdff4fe8 (patch) | |
tree | 3fe7b40a6d22bef254561f200083193d769a496a /sandbox | |
parent | 25d353862ce267a5746acac9e604ce6980f88660 (diff) | |
download | chromium_src-cdf209a4e1c621045cea90a3f4da6f21fdff4fe8.zip chromium_src-cdf209a4e1c621045cea90a3f4da6f21fdff4fe8.tar.gz chromium_src-cdf209a4e1c621045cea90a3f4da6f21fdff4fe8.tar.bz2 |
Explicitly ask for unsigned values when comparing addresses. Not only is this
code hard to understand (and possibly broken) otherwise, some versions of
GCC complain about the comparison without the cast.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/657034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39838 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/linux/seccomp/maps.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sandbox/linux/seccomp/maps.cc b/sandbox/linux/seccomp/maps.cc index f5c37c4..cb303e7 100644 --- a/sandbox/linux/seccomp/maps.cc +++ b/sandbox/linux/seccomp/maps.cc @@ -213,8 +213,8 @@ char* Maps::allocNearAddr(char* addr_target, size_t size, int prot) const { // the GROWS_DOWN region. Pick the farthest away region that // is still within the gap. - if (addr < kMaxDistance || // Underflow protection. - addr - kMaxDistance < gap_start) { + if (static_cast<unsigned long>(addr) < kMaxDistance || // Underflow protection. + static_cast<unsigned long>(addr) - kMaxDistance < gap_start) { position = gap_start; } else { position = addr - kMaxDistance; |