RESOLVED FIXED 158118
ScopedLambda should have a lifetime story that makes sense to the compiler
https://bugs.webkit.org/show_bug.cgi?id=158118
Summary ScopedLambda should have a lifetime story that makes sense to the compiler
Filip Pizlo
Reported 2016-05-26 08:06:47 PDT
ScopedLambdaFunctor currently gets a reference to the passed lambda, and if RVO gets disabled, it will lead to the creation of a ScopedLambda whose m_arg points at dead memory.
Attachments
the patch (7.73 KB, patch)
2016-05-26 08:12 PDT, Filip Pizlo
no flags
performance (77.37 KB, text/plain)
2016-05-26 09:17 PDT, Filip Pizlo
no flags
the patch (15.26 KB, patch)
2016-05-26 12:02 PDT, Filip Pizlo
mark.lam: review+
Filip Pizlo
Comment 1 2016-05-26 08:12:55 PDT
Created attachment 279884 [details] the patch I'm testing this now. I'll put it up for review once I know that it actually works. Also, I'm going to add a test case for this. I think I know how to do that.
Filip Pizlo
Comment 2 2016-05-26 09:17:26 PDT
Created attachment 279890 [details] performance Looks good.
WebKit Commit Bot
Comment 3 2016-05-26 11:07:05 PDT
Attachment 279884 [details] did not pass style-queue: ERROR: Source/WTF/wtf/ScopedLambda.h:78: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WTF/wtf/ScopedLambda.h:84: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 2 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Filip Pizlo
Comment 4 2016-05-26 12:02:05 PDT
Created attachment 279901 [details] the patch
WebKit Commit Bot
Comment 5 2016-05-26 12:03:45 PDT
Attachment 279901 [details] did not pass style-queue: ERROR: Source/WTF/wtf/ScopedLambda.h:78: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WTF/wtf/ScopedLambda.h:84: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 2 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Mark Lam
Comment 6 2016-05-26 12:33:19 PDT
Comment on attachment 279901 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=279901&action=review r=me > Source/WTF/wtf/ScopedLambda.h:115 > +// We expected scopedLambda to be valid for its entire lifetime, but if it camputed the lambda by reference typo: /camputed/computed/
Filip Pizlo
Comment 7 2016-05-26 12:47:51 PDT
Those test failures look pretty scary, I will wait before landing.
Filip Pizlo
Comment 8 2016-05-26 14:58:30 PDT
Note You need to log in before you can comment on or make changes to this bug.