Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sorry I'm coming with a commit post release, but looking at that patch function I made made me think about the maths that were being done.
And this a correction of them.
Better than leaving it uncorrected.
A bit shall never be set on a THUMB -> ARM BLX op, and this bit was what messed with me the first time i made this code but didn't knew about it. Hence now that added
& ~(1<<16)
.So, the op jump distance math was incorrect because i never fixed that bit, but instead changed the maths of the op distance, originally.
Old code was basically doing
(Destination_offset - blx_op_offset+4) / 2
instead of+2
, which worked as mentioned on commit message, by sheer luck of offsets.But now this new code is correct.