RESOLVED FIXED 47055
All the WebSocket tests crash
https://bugs.webkit.org/show_bug.cgi?id=47055
Summary All the WebSocket tests crash
Adam Barth
Reported 2010-10-03 01:03:50 PDT
All the WebSocket tests crash
Attachments
Patch (1.64 KB, patch)
2010-10-03 01:05 PDT, Adam Barth
zecke: review+
Adam Barth
Comment 1 2010-10-03 01:05:48 PDT
Holger Freyther
Comment 2 2010-10-03 01:13:32 PDT
Comment on attachment 69583 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=69583&action=review You could keep the 'const'. The patch looks sane. > WebCore/ChangeLog:9 > + That doesn't work in C++. Instead, we need to actually store the You could remove the extra space.
Adam Barth
Comment 3 2010-10-03 01:19:50 PDT
Darin Adler
Comment 4 2010-10-03 10:37:36 PDT
The C++ standard, section 12.5, paragraph 5, says: "The temporary to which the reference is bound [...] persists for the lifetime of the reference except as specified below.” And the text below does not list any exception which applies here. So the temporary objects here will last the lifetime of the reference. So this code change should not have had any effect at all.
Alexey Proskuryakov
Comment 5 2010-10-03 11:41:43 PDT
This is a fairly common idiom in WebCore code. People have submitted patches to "fix" such code several times in the past, but reviewers stopped that before, and the problem always turned out to be something different. When did this start? Did this happen on buildbots?
Holger Freyther
Comment 6 2010-10-03 11:47:42 PDT
(In reply to comment #5) > This is a fairly common idiom in WebCore code. People have submitted patches to "fix" such code several times in the past, but reviewers stopped that before, and the problem always turned out to be something different. I was not aware that it is valid until the end of the block. I was doing this example http://paste.lisp.org/display/115156 for adam to show that it is at least valid for function calls. The other thing is, I think it is to be preferred to not use const reference as it can have suprising effects and as long as the function being called is inline, gcc will be able to eliminate the copy (since early gcc 3.x), as can be seen when compiling/executing the example. Anyway, I will be more careful. > > When did this start? Did this happen on buildbots? Leaving that to Adam.
Note You need to log in before you can comment on or make changes to this bug.