ahatanak added a comment.
Seems like the chromium code is valid and shouldn't crash. John/Erik what do
you think? The following code also crashes with this patch applied.
typedef void (^BlockTy)();
BlockTy sb;
__weak BlockTy wb;
void foo(id a) {
auto b = ^{ NSLog(@"foo %@", a); };
wb = b; // block isn't copied to the heap.
sb = b; // block is copied to the heap.
}
int main() {
auto x = [NSObject new];
foo(x);
sb();
wb();
return 0;
}
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58514/new/
https://reviews.llvm.org/D58514
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits