Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMD asm: Cannot access struct members #950

Open
redstar opened this issue May 30, 2015 · 2 comments
Open

DMD asm: Cannot access struct members #950

redstar opened this issue May 30, 2015 · 2 comments

Comments

@redstar
Copy link
Member

redstar commented May 30, 2015

The following code compiles with DMD but not with LDC:

module app.d;

import std.stdio;

struct test {
        uint a = 42;
        uint b = 7;

        uint getA() {
                uint temp;
                asm {
                        mov RBX, this;
                        mov EAX, a[RBX];
                        mov temp, EAX;
                }
                return temp;
        }
}

public static void main() {
        writeln("asm 'this' test");
        test t;
        writeln("test.getA(): ", t.getA());
        assert(t.getA() == t.a, "getA() failed");
}

Reported by this.getName() in ldc forum.

@dnadlinger dnadlinger changed the title DMD asm: Cannot acces struct members DMD asm: Cannot access struct members Jul 4, 2015
@kinke
Copy link
Member

kinke commented Mar 28, 2016

@redstar You fixed this, right?

@kinke
Copy link
Member

kinke commented Mar 28, 2016

Nope still doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants