* Tactic B1: replace the instruction with a jump. */
| 450 | * Tactic B1: replace the instruction with a jump. |
| 451 | */ |
| 452 | static Patch *tactic_B1(Binary &B, Instr *I, const Trampoline *T, |
| 453 | Tactic tactic = TACTIC_B1) |
| 454 | { |
| 455 | if (I->size < JMP_SIZE || !option_tactic_B1 || !canPatch(I)) |
| 456 | return nullptr; |
| 457 | const Alloc *A = allocateJump(B, I, T); |
| 458 | if (A == nullptr) |
| 459 | return nullptr; |
| 460 | Patch *P = new Patch(I, tactic, A); |
| 461 | patchJump(P, /*offset=*/0); |
| 462 | patchUnused(P, /*offset=sizeof(jmpq)=*/5); |
| 463 | return P; |
| 464 | } |
| 465 | |
| 466 | /* |
| 467 | * Tactic B2: replace the instruction with a punned jump. |
no test coverage detected