[Bug 100] New: Assert statement error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 11 04:08:39 PDT 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=100

           Summary: Assert statement error
           Product: D
           Version: 0.153
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: dronten at gmail.com


assert statements is not behaving as they used to do.
Here is a short test program.

gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu3)
Linux ubuntu 2.6.15-18-686 #1 SMP PREEMPT Thu Mar 9 15:29:22 UTC 2006 i686
GNU/Linux

#!/bin/rdmd
import std.stdio;

void main() {
    char[] a = "";
    try {
        if (a.length != 66) {
            writefln("ASSERT NOW");
            assert(false);
        }
        writefln("What the f...");
    }
    catch {
        writefln("catch");
    }
}

--- Test run 1
~/Documents/src/d/test: dmd ass.d
gcc ass.o -o ass -lphobos -lpthread -lm -Xlinker --gc-sections
~/Documents/src/d/test: ./ass
ASSERT NOW
Segmentation fault


--- Test run 2
~/Documents/src/d/test: dmd -g ass.d
gcc ass.o -o ass -g -lphobos -lpthread -lm -Xlinker --gc-sections
~/Documents/src/d/test: ./ass
ASSERT NOW
What the f...


--- Test run 3 (with rdmd)
~/Documents/src/d/test: ./ass.d
ASSERT NOW


---Test run 4 (dmd 1.50)
~/Documents/src/d/test: dmd -g ass.d
gcc ass.o -o ass -g -lphobos -lpthread -lm
~/Documents/src/d/test: ./ass
ASSERT NOW
catch


-- 




More information about the Digitalmars-d-bugs mailing list