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.
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.
Created attachment 279890 [details] performance Looks good.
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.
Created attachment 279901 [details] the patch
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.
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/
Those test failures look pretty scary, I will wait before landing.
Landed in http://trac.webkit.org/changeset/201433