[Issue 18928] New: extern(C++) bad codegen, wrong calling convention

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 31 18:01:47 UTC 2018


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

          Issue ID: 18928
           Summary: extern(C++) bad codegen, wrong calling convention
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: turkeyman at gmail.com

Created attachment 1698
  --> https://issues.dlang.org/attachment.cgi?id=1698&action=edit
Test app

Crashing from bad codegen, uses wrong registers passing arguments.

Test calls a static function and a virtual function. Static function works as
expected, virtual call crashes.

Open the project in VS2015 (others may work) and build + run.
Place a breakpoint in the virtual `addUser`function and notice that it didn't
receive its argument correctly, and also fails to return its result correct.

Static version of the function calls properly.

--


More information about the Digitalmars-d-bugs mailing list