[Bug 207] _d_throw is not treated as `noreturn`.
via D.gnu
d.gnu at puremagic.com
Sat Jan 9 02:27:20 PST 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=207
art.08.09 at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |art.08.09 at gmail.com
--- Comment #3 from art.08.09 at gmail.com ---
(In reply to Iain Buclaw from comment #1)
> It should be the same as calling a function which noreturn attribute set.
Hence $summary ;)
I was surprised that this was not already the case, and by
the cost (I was playing with the new arithmetic builtins and
the impact on calling/surrounding code was significant; the
dead post-throw code emitted isn't that much of a problem).
BTW, there's a similar issue w/ D's asserts (_d_assert) in
non-release builds.
But there, I'm not sure if assuming no return is legal (no
spec is fun...). Still, I ended up using:
{ assert (0); import gcc.builtins; __builtin_trap(); }
instead of `assert(0)`. At least for the `assert(0)` case
emitting that trap unconditionally seems OK (it's what
happens in release-mode anyway, so recovery is already
impossible).
--
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20160109/261b39c4/attachment.html>
More information about the D.gnu
mailing list