| 495 | } |
| 496 | } |
| 497 | static Patch *tactic_T1(Binary &B, Instr *I, const Trampoline *T, |
| 498 | Tactic tactic = TACTIC_T1) |
| 499 | { |
| 500 | if (I->size >= JMP_SIZE || !option_tactic_T1 || !canPatch(I)) |
| 501 | return nullptr; |
| 502 | for (unsigned prefix = 1; prefix < JMP_REL32_SIZE && canApplyT1(I, prefix); |
| 503 | prefix++) |
| 504 | { |
| 505 | if (prefix >= I->size) |
| 506 | break; |
| 507 | const Alloc *A = allocatePunnedJump(B, I, prefix, I, T); |
| 508 | if (A != nullptr) |
| 509 | { |
| 510 | Patch *P = new Patch(I, tactic, A); |
| 511 | patchJumpPrefix(P, prefix); |
| 512 | patchJump(P, prefix); |
| 513 | return P; |
| 514 | } |
| 515 | } |
| 516 | return nullptr; |
| 517 | } |
| 518 | |
| 519 | /* |
| 520 | * Tactic T2: evict the successor instruction. |
no test coverage detected