mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-0: More test fixes.
This commit is contained in:
@@ -212,10 +212,13 @@ public class SemisparseByteArray {
|
|||||||
*/
|
*/
|
||||||
public synchronized void putData(final long loc, final byte[] data, final int offset,
|
public synchronized void putData(final long loc, final byte[] data, final int offset,
|
||||||
final int length) {
|
final int length) {
|
||||||
|
if (length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (length < 0) {
|
if (length < 0) {
|
||||||
throw new IllegalArgumentException("length: " + length);
|
throw new IllegalArgumentException("length: " + length);
|
||||||
}
|
}
|
||||||
if (Long.compareUnsigned(loc + length, loc) < 0) {
|
if (Long.compareUnsigned(loc + length - 1, loc) < 0) {
|
||||||
throw new IndexOutOfBoundsException("given offset and length would exceed ULONG_MAX");
|
throw new IndexOutOfBoundsException("given offset and length would exceed ULONG_MAX");
|
||||||
}
|
}
|
||||||
UnsignedLong uLoc = UnsignedLong.fromLongBits(loc);
|
UnsignedLong uLoc = UnsignedLong.fromLongBits(loc);
|
||||||
|
|||||||
Reference in New Issue
Block a user