MCPcopy Index your code
hub / github.com/GJDuck/e9patch / commit

Function commit

src/e9patch/e9tactics.cpp:116–156  ·  view source on GitHub ↗

* Commit a patch. */

Source from the content-addressed store, hash-verified

114 * Commit a patch.
115 */
116static void commit(Binary &B, Patch *P)
117{
118 switch (P->tactic)
119 {
120 case TACTIC_B0:
121 stat_num_B0++;
122 break;
123 case TACTIC_B1:
124 stat_num_B1++;
125 break;
126 case TACTIC_B2:
127 stat_num_B2++;
128 break;
129 case TACTIC_T0:
130 stat_num_T0++;
131 break;
132 case TACTIC_T1:
133 stat_num_T1++;
134 break;
135 case TACTIC_T2:
136 stat_num_T2++;
137 break;
138 case TACTIC_T3:
139 stat_num_T3++;
140 break;
141 }
142
143 if (P->tactic == TACTIC_B0)
144 B.Traps.push_back(P->A);
145
146 while (P != nullptr)
147 {
148 if (P->A != nullptr)
149 setTrampolineEntry(B.Es, P->I, P->A->lb + P->A->entry);
150
151 // Delete the P (we do not need it anymore)
152 Patch *Q = P;
153 P = P->next;
154 delete Q;
155 }
156}
157
158/*
159 * Undo the application of a patch.

Callers 1

patchFunction · 0.85

Calls 1

setTrampolineEntryFunction · 0.85

Tested by

no test coverage detected