[Webkit-unassigned] [Bug 84980] Random crashes in webkit if a compiler addresses C++ defect #391

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 26 14:11:44 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=84980





--- Comment #5 from Anders Carlsson <andersca at apple.com>  2012-04-26 14:11:44 PST ---
I asked Richard Smith who works on clang, and here's what he had to say:

<zygoloid> andersca: ugh. ok. in c++11, that code is fine, because the conditional operator will copy-initialize a temporary to hold its result, and the reference will extend the lifetime of that temporary.
<andersca> zygoloid: i see
<zygoloid> in c++03, the result is 'the value of the second or third expression'. we apply an lvalue-to-rvalue conversion on the third expression, but don't build a temporary. so it's not clear whether the result of the ?: is a temporary or not
<zygoloid> if it's not, 391 removes the permission for a temporary to be created, so the lifetime can't be extended
<andersca> ah!
<zygoloid> however... issue 446 fixes ?: to create a temporary whenever it produces a class prvalue
<zygoloid> imo a compiler which implements 391 but not 446 is broken

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list