Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Crash converting case expression to NSExpression #11613

Closed

Description

@1ec5

On an iOS debug build, the JSON expression object below crashes with a nonsensical assertion:

NSArray *jsonExpression = @[
    @"case",
    @[
        @"<",
        @[@"get", @"area"],
        @80000
    ],
    @[@"get", @"abbr"],
    @[@"get", @"name_en"]
];
[NSExpression mgl_expressionWithJSONObject:jsonExpression];
2018-04-05 20:52:05.100190-0700 Mapbox GL[51160:1468600] [General] Unrecognized expression conditional operator get.
2018-04-05 20:52:05.116255-0700 Mapbox GL[51160:1468600] [General] (
	0   CoreFoundation                      0x00007fff3663932b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x00007fff5dcb3c76 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff3663f0c2 +[NSException raise:format:arguments:] + 98
	3   Foundation                          0x00007fff3875b340 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
	4   Mapbox                              0x000000010077e323 +[NSPredicate(MGLExpressionAdditions) mgl_predicateWithJSONObject:] + 6691
	5   Mapbox                              0x0000000100434dd3 +[NSExpression(MGLAdditions) mgl_expressionWithJSONObject:] + 20243

NSAssert(NO, @"Unrecognized expression conditional operator %@.", op);
return nil;

/cc @fabian-guerra

Activity

  1. added
    iOS
    macOS
    on Apr 6, 2018
  2. added this to the milestone on Apr 6, 2018
  3. self-assigned this
    on Apr 6, 2018
  4. 1ec5 commented on Apr 6, 2018

    @1ec5
    ContributorAuthor

    Fixed in #11615 on the release-boba branch for iOS map SDK v4.0.0 and macOS map SDK v0.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

crashiOSmacOSruntime styling

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions