The end location of the range would be changed into its expansion location, but the beginning of the range would stay as a spelling location. This would lead to very weird ranges spanning large parts of a file (starting in a macro until its expansion).
This bug was not previously caught because there was no way to actually obtain a spelling location via libclang (see my patch at D20125 which adds support for this), so later obtaining the start location of a range would result in an expansion location anyway, and wind up matching the expansion location that was stored in the end of the range.