From baae2be198bc6f8160ccc771b94557f983d9ab07 Mon Sep 17 00:00:00 2001 From: Jaume Bosch Date: Tue, 30 Oct 2018 08:20:37 +0100 Subject: [PATCH] Always return the conflicting addr and len in MemoryMap::insert --- src/support/memorymap.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/support/memorymap.cpp b/src/support/memorymap.cpp index 2d8065ffd..a0ae4c2b1 100644 --- a/src/support/memorymap.cpp +++ b/src/support/memorymap.cpp @@ -59,7 +59,7 @@ void MemoryMap< uint64_t >::insertWithOverlapButNotGenerateIntersects( const Mem MemoryChunk iterKey = key; bool reuseFirstPos = false; int firstCase = 0; - + if ( !this->empty() ) { if ( hint != this->begin() ) @@ -269,6 +269,11 @@ uint64_t MemoryMap< uint64_t >::getExactOrFullyOverlappingInsertIfNotFound( uint ov == MemoryChunk::SUBCHUNK_END_OVERLAP) { val = it->second; exact = false; + } else { + conflictAddr = it->first.getAddress(); + conflictSize = it->first.getLength(); + val = valIfNotValid; + exact = false; } } } else if ( this->key_comp()( key, it->first ) ) { @@ -290,11 +295,12 @@ uint64_t MemoryMap< uint64_t >::getExactOrFullyOverlappingInsertIfNotFound( uint ov == MemoryChunk::SUBCHUNK_END_OVERLAP) { val = it->second; exact = false; + } else { + conflictAddr = it->first.getAddress(); + conflictSize = it->first.getLength(); + val = valIfNotValid; + exact = false; } - - //it = this->insert( it, BaseMap::value_type( key, valIfNotFound ) ); - //val = it->second; - //exact = true; } } else { conflictAddr = it->first.getAddress(); -- GitLab