www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12635] New: Accepts Invalid Segment Prefix on Branch


          Issue ID: 12635
           Summary: Accepts Invalid Segment Prefix on Branch Instruction
           Product: D
           Version: D2
          Hardware: x86
               URL: http://github.com/D-Programming-Language/dmd/pull/3483
                OS: All
            Status: NEW
          Keywords: accepts-invalid, diagnostic, iasm, pull, wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
          Assignee: blah38621 gmail.com
          Reporter: blah38621 gmail.com

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.

Apr 24 2014