[Issue 14587] DMD 2.067.1 generating crashing binary on OSX

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri May 15 09:36:06 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14587

Marc Schütz <schuetzm at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
                 OS|Mac OS X                    |All

--- Comment #4 from Marc Schütz <schuetzm at gmx.net> ---
It crashes upon entering the jump table:

(gdb) disas
Dump of assembler code for function _D2xx3fooFS2xx4CardZv:
   0x000000000041c7b0 <+0>:    push   %rbp
   0x000000000041c7b1 <+1>:    mov    %rsp,%rbp
   0x000000000041c7b4 <+4>:    sub    $0x10,%rsp
   0x000000000041c7b8 <+8>:    mov    %rdi,-0x8(%rbp)
   0x000000000041c7bc <+12>:    cmp    $0xb,%edi
   0x000000000041c7bf <+15>:    ja     0x41c7c8 <_D2xx3fooFS2xx4CardZv+24>
=> 0x000000000041c7c1 <+17>:    jmpq   *0x4374f8(,%rdi,8)
   0x000000000041c7c8 <+24>:    leaveq 
   0x000000000041c7c9 <+25>:    retq   

(gdb) print $edi
$1 = 11
(gdb) print $rdi
$2 = 4294967307

As you can see, %edi contains the correct offset, but it uses %rdi as an index.
Most likely a bug in the code generator.

--


More information about the Digitalmars-d-bugs mailing list