Commit 460396a7 authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Fixes a crash in -[CRWWebViewScrollViewDelegateProxy forwardInvocation:].

-[NSInvocation getArgument:atIndex:] fills its argument into a void* and
therefore doesn't trigger an ARC-synthesized retain. If the argument is
stored into a strong pointer, release is called when the pointer goes
out of scope, which causes the object to be overreleased. Annotating the
pointer as __unsafe_unretained avoids this problem.

BUG=1092875

Change-Id: I990c3878b9ab7d828ff17f3a3cf530059f7f5c85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2235656
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776508}
parent 9270ddce
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
if (signature.numberOfArguments >= 3 && if (signature.numberOfArguments >= 3 &&
strcmp([signature getArgumentTypeAtIndex:2], @encode(UIScrollView*)) == strcmp([signature getArgumentTypeAtIndex:2], @encode(UIScrollView*)) ==
0) { 0) {
UIScrollView* sender; __unsafe_unretained UIScrollView* sender;
[invocation getArgument:&sender atIndex:2]; [invocation getArgument:&sender atIndex:2];
if (sender == self.scrollViewProxy.underlyingScrollView) { if (sender == self.scrollViewProxy.underlyingScrollView) {
sender = [self.scrollViewProxy asUIScrollView]; sender = [self.scrollViewProxy asUIScrollView];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment