Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m

Issue 177373009: Compatibility fix for arm64 on iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ocmock.0
Patch Set: Rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/ocmock/OCMock/NSInvocation+OCMAdditions.m ('k') | third_party/ocmock/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m
diff --git a/third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m b/third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m
index 04fda55a3a56bb220091807a82550a0b13b306ee..f409eae9b4a9779c54acea838dde69d80e3a84ac 100644
--- a/third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m
+++ b/third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m
@@ -10,7 +10,10 @@
- (void)handleInvocation:(NSInvocation *)anInvocation
{
- if(strcmp([[anInvocation methodSignature] methodReturnType], [(NSValue *)returnValue objCType]) != 0)
+ const char* returnType = [[anInvocation methodSignature] methodReturnType];
+ const char* valueType = [(NSValue *)returnValue objCType];
+ // ARM64 uses 'B' for BOOLS in method signatures but 'c' in NSValue; that case should match.
+ if(strcmp(returnType, valueType) != 0 && !(strcmp(returnType, "B") == 0 && strcmp(valueType, "c") == 0))
@throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Return value does not match method signature." userInfo:nil];
void *buffer = malloc([[anInvocation methodSignature] methodReturnLength]);
[returnValue getValue:buffer];
« no previous file with comments | « third_party/ocmock/OCMock/NSInvocation+OCMAdditions.m ('k') | third_party/ocmock/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698