Bug 100 – Assert statement error

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-04-11T06:08:00Z
Last change time
2014-02-15T02:09:58Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
dronten

Comments

Comment #0 by dronten — 2006-04-11T06:08:38Z
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
Comment #1 by bugzilla — 2006-06-14T22:54:25Z
This was caused by the --gc-sections, since removed.