When the branch target of a Thumb2 unconditional or conditonal branch is resolved at assembly time, no range checking is performed on the result leading to incorrect immediates when the maximum range is exceeded. This change adds a range check: +- 16 Megabytes for unconditional branches, +- 1 Megabyte for the conditional branch.
The ranges for the branch instructions can be found in https://developer.arm.com/docs/ddi0406/c/arm-architecture-reference-manual-armv7-a-and-armv7-r-edition
For version C (latest) the higher range can be found in A4.3 Branch instructions. The conditional branch range can be found in A8.8.18 B encoding T3.
I think using CHECK-LABEL to separate the checks might it slightly easier to track down failures in the future.