From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] x86_emulate: fix side-effect macro call
Date: Tue, 5 Feb 2008 15:33:55 +0000 [thread overview]
Message-ID: <20080205153355.GA10999@implementation.uk.xensource.com> (raw)
x86_emulate: fix side-effect macro call
Both jmp_rel and insn_fetch_type increment eip, so it's not
compiler-safe to nest the calls.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
---
Yes, I actually got a bug because of this, with debian's gcc 4.2.3.
diff -r 52f222b319ef xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c Tue Feb 05 11:21:22 2008 +0000
+++ b/xen/arch/x86/x86_emulate.c Tue Feb 05 15:30:48 2008 +0000
@@ -2644,9 +2644,11 @@
break;
}
- case 0xeb: /* jmp (short) */
- jmp_rel(insn_fetch_type(int8_t));
+ case 0xeb: /* jmp (short) */ {
+ int8_t rel = insn_fetch_type(int8_t);
+ jmp_rel(rel);
break;
+ }
case 0xf1: /* int1 (icebp) */
src.val = EXC_DB;
next reply other threads:[~2008-02-05 15:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-05 15:33 Samuel Thibault [this message]
2008-02-05 15:37 ` [PATCH] x86_emulate: fix side-effect macro call Samuel Thibault
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080205153355.GA10999@implementation.uk.xensource.com \
--to=samuel.thibault@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.