Bug 14308 – Compiling druntime with -release breaks range exceptions

Status
REOPENED
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-03-19T10:00:06Z
Last change time
2024-12-07T13:34:59Z
Assigned to
No Owner
Creator
Temtaime
Moved to GitHub: dmd#17294 →

Comments

Comment #0 by temtaime — 2015-03-19T10:00:06Z
Hi ! When i compile druntime with -release flag and then builds an app using it, following code crashes: ubyte[3] aa; int n = 4; aa[n] = 5; If i compile it without -release, then all is OK. I don't know how this flag affects range exceptions in applications. Also i don't know is it a bug or as designed. But i think that druntime with -release flag should work.
Comment #1 by ketmar — 2015-03-19T16:00:03Z
this is the expected result: "-release" flag turns off bounds checking. it was designed to do so. using "-release" means "i fully debugged my code and i'm sure that there either no out-of-bounds errors, or i'm checking that manually". so i'm closing the bug as invalid.
Comment #2 by ketmar — 2015-03-19T16:01:41Z
oooops. sorry. today is not a my day.
Comment #3 by temtaime — 2015-03-19T16:03:42Z
It's OK, but bounds checks are in my app compiled with different flags, not in druntime. Also if i compile it with -noboundscheck and without -release, all is working!
Comment #4 by temtaime — 2015-03-19T16:04:19Z
*it, i mean druntime
Comment #5 by ketmar — 2015-03-19T16:10:27Z
yes, sorry, i misread your report.
Comment #6 by robert.schadek — 2024-12-07T13:34:59Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17294 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB