vmt / udis86

Disassembler Library for x86 and x86-64
http://udis86.sourceforge.net
BSD 2-Clause "Simplified" License
1.02k stars 298 forks source link

ud_translate_att: AT&T mnemonic size suffix logic seems suspect #131

Closed qetchlijn closed 4 years ago

qetchlijn commented 4 years ago

The function ud_translate_att in syn-att.c declares a local variable, size, and sets it to zero:

extern void 
ud_translate_att(struct ud *u)
{
  int size = 0;

A bit further down there's code conditional on size to append a size suffix to the mnemonic:

if (size == 8) {
  ud_asmprintf(u, "b");
} else if (size == 16) {
  ud_asmprintf(u, "w");
} else if (size == 64) {
  ud_asmprintf(u, "q");
}

However, size is never changed from its initial value of zero, so the suffix is never added.

Should there be some additional logic to change the value of size in cases where a size suffix is required?

qetchlijn commented 4 years ago

I'm closing this as it duplicates a problem noted in issue #113.