https://issues.dlang.org/show_bug.cgi?id=23472

kinke <ki...@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ki...@gmx.net

--- Comment #1 from kinke <ki...@gmx.net> ---
The frontend lowers this to:

```
char inc(string s, ref int i)
{
        bool __os2 = false;
        try
        {
                try
                {
                        return s[cast(ulong)i];
                }
                catch(Throwable __o3)
                {
                        __os2 = true;
                        throw __o3;
                }
        }
        finally
                if (!__os2)
                        i++;
}
```

So the increment is to be skipped if the bounds check fails. Using -release
etc. allows the LLVM optimizer to get rid of all EH boilerplate.

--

Reply via email to