Thread overview
Possible bug - should the following code cause an access violation exception?
Dec 30, 2013
Afshin
Dec 30, 2013
Ali Çehreli
Dec 31, 2013
Afshin
Dec 31, 2013
Ali Çehreli
December 30, 2013
module test;

class Foo {
    public static ulong next = 0;

    public static ulong getNext() {
        return next++;
    }
}

void main() {
    Foo.getNext();
}

/*
The next++ is the culprit.
Using a ++next does not throw an exception.
*/
December 30, 2013
On 12/29/2013 10:38 PM, Afshin wrote:
> module test;
>
> class Foo {
>      public static ulong next = 0;
>
>      public static ulong getNext() {
>          return next++;
>      }
> }
>
> void main() {
>      Foo.getNext();
> }
>
> /*
> The next++ is the culprit.
> Using a ++next does not throw an exception.
> */

Must have already been fixed. No problem on git head.

Ali

December 31, 2013
Thanks Ali.

I uninstalled 2.63.x.
Installed the 2.64.2.

I compiled and ran the test, and surely enough there were no problems.

However, when I build using Visual D environment, the problem persists.

Microsoft Visual Studio 2010 Ultimate.
Visual D plugin.

Thankfully, there is a simple workaround, but hopefully someone can get to the bottom of this issue.

December 31, 2013
On 12/30/2013 04:55 PM, Afshin wrote:
> Thanks Ali.
>
> I uninstalled 2.63.x.
> Installed the 2.64.2.
>
> I compiled and ran the test, and surely enough there were no problems.
>
> However, when I build using Visual D environment, the problem persists.
>
> Microsoft Visual Studio 2010 Ultimate.
> Visual D plugin.
>
> Thankfully, there is a simple workaround, but hopefully someone can get
> to the bottom of this issue.
>

Not unless somebody files a bug report. ;)

  https://d.puremagic.com/issues/

Ali