Bug 12635 – Accepts Invalid Segment Prefix on Branch Instruction

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2014-04-24T16:10:41Z
Last change time
2022-08-22T14:57:37Z
Keywords
accepts-invalid, diagnostic, iasm, pull, wrong-code
Assigned to
Orvid King
Creator
Orvid King

Comments

Comment #0 by blah38621 — 2014-04-24T16:10:41Z
Currently it's possible to explicitly specify the base segment of a label in inline asm, however the use of segment prefixes on branch instructions is reserved according to the intel manual. In fact, the DS and CS segment prefixes actually represent the hint taken and hint not taken prefixes for branching operations.This is an issue for both x86 & x86_64, but I can't set both in the hardware field. I noticed this bug when I went to allow labels as operands to inline assembly operations. I also included the fix for this issue in that PR, as I would really like to see it merged, to solve a current limitation of the inline assembly that makes code trying to use a jump table an absurd mess. The fix in the PR is to add an error explicitly for setting a non-default segment for a branching instruction.
Comment #1 by bugzilla — 2020-08-09T10:31:35Z
Anyone know what PR is being referred to here?
Comment #2 by r.sagitario — 2020-08-29T07:54:54Z
Comment #3 by razvan.nitu1305 — 2022-08-22T14:57:37Z
This seems to have been fixed by https://github.com/dlang/dmd/pull/3483/