base: Prevent undefined behavior in not interleaved `AddrRange`s.
authorIsaac Sánchez Barrera <isaac.sanchez@bsc.es>
Mon, 16 Nov 2020 15:22:44 +0000 (16:22 +0100)
committerIsaac Sánchez Barrera <isaac.sanchez@bsc.es>
Tue, 17 Nov 2020 10:46:30 +0000 (10:46 +0000)
commitcaf6a507cb9eecb08673a9ab087af4d9b1ca32d9
tree4213c14438737dd8987e8ce5620d98d12db32a23
parent2f8b5acba110aaf70b646503398c7f3341b49732
base: Prevent undefined behavior in not interleaved `AddrRange`s.

If an `AddrRange` is not interleaved, return the input address in
`removeIntlvBits` and `addIntlvBits` to prevent undefined behavior.  It
allows to use these methods in all cases without having to check
manually whether the range is interleaved.

Change-Id: Ic6ac8c4e52b09417bc41aa9380a24319c34e0b35
Signed-off-by: Isaac Sánchez Barrera <isaac.sanchez@bsc.es>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/37617
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
src/base/addr_range.hh