Improve reg detection in asm highlighting + add test ##disasm

This commit is contained in:
Sergi Àlvarez i Capilla 2021-12-21 20:08:11 +01:00
parent 50e1b214bf
commit 545aefe971
2 changed files with 6 additions and 0 deletions

View File

@ -2132,6 +2132,9 @@ static bool is_flag(const char *p) {
while (*e && is_not_token (*e)) {
e++;
}
if (*p == 'r' && isdigit (p[1])) {
p++;
}
size_t len = e? e - p: strlen (p);
return len > 3;
}

View File

@ -26,6 +26,8 @@ wx ff15d2c70100
pi 1
f bar.main = 0x1c7d8
pi 1
wx 4189fe
pi 1
EOF
EXPECT=<<EOF
nop word [rax + rax]
@ -34,6 +36,7 @@ EXPECT=<<EOF
je cow.main
call qword [0x0001c7d8]
call qword [bar.main]
mov r14d, edi
EOF
EXPECT_ERR=
RUN