Bug 11851 – Memory Access Violation Exception on a postfix addition operation.
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
visuald
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2013-12-30T21:47:00Z
Last change time
2014-04-12T10:08:18Z
Assigned to
nobody
Creator
davidnia1
Comments
Comment #0 by davidnia1 — 2013-12-30T21:47:07Z
// The following code throws an access violation exception:
// I am using D compiler version 2.64.2
// Visual Studio 2010 Ultimate
// Visual D
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 ++next does not throw an exception.
*/
Comment #1 by davidnia1 — 2013-12-30T21:47:51Z
The exception is not thrown when compiling and executing from the command line. The error only happens when compiling and executing in Visual Studio using the Visual D tool.
Comment #2 by r.sagitario — 2014-01-01T12:07:57Z
I cannot reproduce here. I guess it will have to do with the options passed to dmd or the linker. Could you please post the build command file (*.cmd in the output directory)?
Comment #3 by r.sagitario — 2014-04-12T10:08:18Z
This looks like a dmd codegen bug to me, but with too little information about the used command line. Please reopen with more information if still valid.