-release compiler switch and associative arrays

Graham Cole grahamc001uk at yahoo.co.uk
Sun Oct 9 04:24:24 PDT 2011


I understand from the documentation that the "-release" compiler switch turns off "array bounds checking for system and trusted functions".

Is it correct that the following code should seg fault when compiled with "-release" ?

string[string] h;
h["abc"] = "def";
string s = h["aaa"];

I.e. retrieving from an associative array for a non existent key.

I would have thought that an exception should be generated in this case when compiled with
"-release" (as it is when compiled without).

This code behaves the same when compiled by both D1 and D2.

Should I report this as a bug ?



More information about the Digitalmars-d-learn mailing list