Bug 90099 - x86 disassembler confuses immediates with addresses
Summary: x86 disassembler confuses immediates with addresses
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-27 14:35 PDT by Filip Pizlo
Modified: 2012-06-27 14:45 PDT (History)
1 user (show)

See Also:


Attachments
the patch (1.35 KB, patch)
2012-06-27 14:37 PDT, Filip Pizlo
mhahnenberg: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2012-06-27 14:35:09 PDT
Consider the two following x86 instructions, written out verbosely:

1) load from address 0x12345 into register RAX
2) move immediate 0x12345 into register RAX

In AT&T syntax, the two should be written thus:

1) mov 0x12345, %rax
2) mov $0x12345, %rax

But our x86 disassembler (udis86) incorrectly writes both as "mov 0x12345, %rax".

In short, it omits the "$" prefix for immediates.
Comment 1 Filip Pizlo 2012-06-27 14:37:32 PDT
Created attachment 149797 [details]
the patch
Comment 2 WebKit Review Bot 2012-06-27 14:41:02 PDT
Attachment 149797 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1
Source/JavaScriptCore/disassembler/udis86/udis86_syn-att.c:112:  Extra space after ( in function call  [whitespace/parens] [4]
Source/JavaScriptCore/disassembler/udis86/udis86_syn-att.c:112:  Extra space before )  [whitespace/parens] [2]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Mark Hahnenberg 2012-06-27 14:44:08 PDT
Comment on attachment 149797 [details]
the patch

r=me
Comment 4 Filip Pizlo 2012-06-27 14:45:46 PDT
Landed in http://trac.webkit.org/changeset/121374