@@ -141,7 +141,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
141
141
if (rex_w && !rex_b && modrm_mod == 3 && modrm_rm == 4 ) {
142
142
143
143
/* add/sub reg, %rsp */
144
- * type = INSN_STACK ;
145
144
ADD_OP (op ) {
146
145
op -> src .type = OP_SRC_ADD ;
147
146
op -> src .reg = op_to_cfi_reg [modrm_reg ][rex_r ];
@@ -154,7 +153,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
154
153
case 0x50 ... 0x57 :
155
154
156
155
/* push reg */
157
- * type = INSN_STACK ;
158
156
ADD_OP (op ) {
159
157
op -> src .type = OP_SRC_REG ;
160
158
op -> src .reg = op_to_cfi_reg [op1 & 0x7 ][rex_b ];
@@ -166,7 +164,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
166
164
case 0x58 ... 0x5f :
167
165
168
166
/* pop reg */
169
- * type = INSN_STACK ;
170
167
ADD_OP (op ) {
171
168
op -> src .type = OP_SRC_POP ;
172
169
op -> dest .type = OP_DEST_REG ;
@@ -178,7 +175,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
178
175
case 0x68 :
179
176
case 0x6a :
180
177
/* push immediate */
181
- * type = INSN_STACK ;
182
178
ADD_OP (op ) {
183
179
op -> src .type = OP_SRC_CONST ;
184
180
op -> dest .type = OP_DEST_PUSH ;
@@ -196,7 +192,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
196
192
197
193
if (modrm == 0xe4 ) {
198
194
/* and imm, %rsp */
199
- * type = INSN_STACK ;
200
195
ADD_OP (op ) {
201
196
op -> src .type = OP_SRC_AND ;
202
197
op -> src .reg = CFI_SP ;
@@ -215,7 +210,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
215
210
break ;
216
211
217
212
/* add/sub imm, %rsp */
218
- * type = INSN_STACK ;
219
213
ADD_OP (op ) {
220
214
op -> src .type = OP_SRC_ADD ;
221
215
op -> src .reg = CFI_SP ;
@@ -229,7 +223,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
229
223
if (rex_w && !rex_r && modrm_mod == 3 && modrm_reg == 4 ) {
230
224
231
225
/* mov %rsp, reg */
232
- * type = INSN_STACK ;
233
226
ADD_OP (op ) {
234
227
op -> src .type = OP_SRC_REG ;
235
228
op -> src .reg = CFI_SP ;
@@ -242,7 +235,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
242
235
if (rex_w && !rex_b && modrm_mod == 3 && modrm_rm == 4 ) {
243
236
244
237
/* mov reg, %rsp */
245
- * type = INSN_STACK ;
246
238
ADD_OP (op ) {
247
239
op -> src .type = OP_SRC_REG ;
248
240
op -> src .reg = op_to_cfi_reg [modrm_reg ][rex_r ];
@@ -258,7 +250,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
258
250
(modrm_mod == 1 || modrm_mod == 2 ) && modrm_rm == 5 ) {
259
251
260
252
/* mov reg, disp(%rbp) */
261
- * type = INSN_STACK ;
262
253
ADD_OP (op ) {
263
254
op -> src .type = OP_SRC_REG ;
264
255
op -> src .reg = op_to_cfi_reg [modrm_reg ][rex_r ];
@@ -270,7 +261,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
270
261
} else if (rex_w && !rex_b && modrm_rm == 4 && sib == 0x24 ) {
271
262
272
263
/* mov reg, disp(%rsp) */
273
- * type = INSN_STACK ;
274
264
ADD_OP (op ) {
275
265
op -> src .type = OP_SRC_REG ;
276
266
op -> src .reg = op_to_cfi_reg [modrm_reg ][rex_r ];
@@ -286,7 +276,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
286
276
if (rex_w && !rex_b && modrm_mod == 1 && modrm_rm == 5 ) {
287
277
288
278
/* mov disp(%rbp), reg */
289
- * type = INSN_STACK ;
290
279
ADD_OP (op ) {
291
280
op -> src .type = OP_SRC_REG_INDIRECT ;
292
281
op -> src .reg = CFI_BP ;
@@ -299,7 +288,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
299
288
modrm_mod != 3 && modrm_rm == 4 ) {
300
289
301
290
/* mov disp(%rsp), reg */
302
- * type = INSN_STACK ;
303
291
ADD_OP (op ) {
304
292
op -> src .type = OP_SRC_REG_INDIRECT ;
305
293
op -> src .reg = CFI_SP ;
@@ -314,7 +302,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
314
302
case 0x8d :
315
303
if (sib == 0x24 && rex_w && !rex_b && !rex_x ) {
316
304
317
- * type = INSN_STACK ;
318
305
ADD_OP (op ) {
319
306
if (!insn .displacement .value ) {
320
307
/* lea (%rsp), reg */
@@ -332,7 +319,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
332
319
} else if (rex == 0x48 && modrm == 0x65 ) {
333
320
334
321
/* lea disp(%rbp), %rsp */
335
- * type = INSN_STACK ;
336
322
ADD_OP (op ) {
337
323
op -> src .type = OP_SRC_ADD ;
338
324
op -> src .reg = CFI_BP ;
@@ -350,7 +336,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
350
336
* Restoring rsp back to its original value after a
351
337
* stack realignment.
352
338
*/
353
- * type = INSN_STACK ;
354
339
ADD_OP (op ) {
355
340
op -> src .type = OP_SRC_ADD ;
356
341
op -> src .reg = CFI_R10 ;
@@ -368,7 +353,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
368
353
* Restoring rsp back to its original value after a
369
354
* stack realignment.
370
355
*/
371
- * type = INSN_STACK ;
372
356
ADD_OP (op ) {
373
357
op -> src .type = OP_SRC_ADD ;
374
358
op -> src .reg = CFI_R13 ;
@@ -382,7 +366,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
382
366
383
367
case 0x8f :
384
368
/* pop to mem */
385
- * type = INSN_STACK ;
386
369
ADD_OP (op ) {
387
370
op -> src .type = OP_SRC_POP ;
388
371
op -> dest .type = OP_DEST_MEM ;
@@ -395,7 +378,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
395
378
396
379
case 0x9c :
397
380
/* pushf */
398
- * type = INSN_STACK ;
399
381
ADD_OP (op ) {
400
382
op -> src .type = OP_SRC_CONST ;
401
383
op -> dest .type = OP_DEST_PUSHF ;
@@ -404,7 +386,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
404
386
405
387
case 0x9d :
406
388
/* popf */
407
- * type = INSN_STACK ;
408
389
ADD_OP (op ) {
409
390
op -> src .type = OP_SRC_POPF ;
410
391
op -> dest .type = OP_DEST_MEM ;
@@ -443,7 +424,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
443
424
} else if (op2 == 0xa0 || op2 == 0xa8 ) {
444
425
445
426
/* push fs/gs */
446
- * type = INSN_STACK ;
447
427
ADD_OP (op ) {
448
428
op -> src .type = OP_SRC_CONST ;
449
429
op -> dest .type = OP_DEST_PUSH ;
@@ -452,7 +432,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
452
432
} else if (op2 == 0xa1 || op2 == 0xa9 ) {
453
433
454
434
/* pop fs/gs */
455
- * type = INSN_STACK ;
456
435
ADD_OP (op ) {
457
436
op -> src .type = OP_SRC_POP ;
458
437
op -> dest .type = OP_DEST_MEM ;
@@ -469,7 +448,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
469
448
* mov bp, sp
470
449
* pop bp
471
450
*/
472
- * type = INSN_STACK ;
473
451
ADD_OP (op )
474
452
op -> dest .type = OP_DEST_LEAVE ;
475
453
@@ -537,7 +515,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec,
537
515
else if (modrm_reg == 6 ) {
538
516
539
517
/* push from mem */
540
- * type = INSN_STACK ;
541
518
ADD_OP (op ) {
542
519
op -> src .type = OP_SRC_CONST ;
543
520
op -> dest .type = OP_DEST_PUSH ;
0 commit comments