mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-28 23:21:46 +00:00
fixed bug in memory block split
This commit is contained in:
parent
7f2dde2c27
commit
c67b9e44bb
@ -216,6 +216,7 @@ abstract class SubMemoryBlock {
|
||||
* @throws IOException if a database error occurs.
|
||||
*/
|
||||
protected void setParentIdAndStartingOffset(long key, long startingOffset) throws IOException {
|
||||
this.startingOffset = startingOffset;
|
||||
record.setLongValue(MemoryMapDBAdapter.SUB_PARENT_ID_COL, key);
|
||||
record.setLongValue(MemoryMapDBAdapter.SUB_START_OFFSET_COL, startingOffset);
|
||||
adapter.updateSubBlockRecord(record);
|
||||
|
@ -406,6 +406,16 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
||||
assertEquals(10, sourceInfo.getLength());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSplitAfterExpand() throws Exception {
|
||||
FileBytes fileBytes = createFileBytes();
|
||||
MemoryBlock block1 = createFileBytesBlock(fileBytes, addr(0), 0, 50);
|
||||
MemoryBlock block2 = mem.createBlock(block1, block1.getName() + ".exp", addr(50), 50);
|
||||
MemoryBlock expandedBlock = mem.join(block1, block2);
|
||||
mem.split(expandedBlock, addr(50));
|
||||
assertEquals(0, mem.getByte(addr(50)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSplitFileBytes() throws Exception {
|
||||
FileBytes fileBytes = createFileBytes();
|
||||
|
Loading…
Reference in New Issue
Block a user