[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Redundant repz prefixes in generated amd64 code
From: |
Johannes Schindelin |
Subject: |
Re: [Qemu-devel] Redundant repz prefixes in generated amd64 code |
Date: |
Sat, 17 Mar 2007 10:51:55 +0100 (CET) |
Hi,
On Sat, 17 Mar 2007, axel wrote:
> Why there exist two different blocks for COFF and ELF for x86/x86_64
> hosts?
Because COFF is used by Windows, and ELF by Linux, and they are
substantially different?
> @@ -1458,6 +1458,8 @@
> error("empty code for %s", name);
> if (p_end[-1] == 0xc3) {
> len--;
> + if ( len>0 && p_end[-2] == 0xf3 )
> + --len;
This is wrong in several accounts:
- style (space after opening parentheses and before closing parentheses,
no space before and after ">", "--" before instead of after "len", just
see the if clause above)
- if you want to access "p_end[-2]", you must check for "len > 1"
- you most likely want to check "p_end[-1]" anyway
- worst: there is no appropriate explanation why this patch is needed, and
even more importantly, why it does not break existing code
Hth,
Dscho