Closed ac101m closed 4 years ago
A further thought, modifying the < operator solves the problem but I don't think the < operator is very idiomatic in this case. How can you state that one range of memory is less than or greater than another? Best practice would probably be to remove the operator and specialise std::less or write a comparator instead. Here's an example: https://stackoverflow.com/questions/1102392/how-can-i-use-stdmaps-with-user-defined-types-as-key I can do this if you think it is worthwhile.
Thank you for your contribution and sorry for the delay in the merge process.
By default STL will use the < operator for the key type when inserting or looking up a key/value pair in std::map. DepsRegion has an overridden < operator and is used as a key value in a few maps in the cregions plugin. However the operator didn't take account of the end address of the region. This caused funky things to happen.