Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oc版本,解到乱码,jceinputStream里会进断言 #19

Open
liaogang opened this issue Jul 7, 2023 · 0 comments
Open

oc版本,解到乱码,jceinputStream里会进断言 #19

liaogang opened this issue Jul 7, 2023 · 0 comments

Comments

@liaogang
Copy link

liaogang commented Jul 7, 2023

在jceinputStream.m里的, 各种断言,建议改成抛错处理,至少程序不会崩溃

  • (NSNumber *)readNumber:(int)tag required:(BOOL)required
    {
    [self peakHead];
    if (_headTag != tag)
    {
    assert(required == NO);
    return nil;
    }
    else
    {
    [self readHead];
    switch (_headType)
    {
    case TARS_TYPE_ZERO:
    return [NSNumber numberWithChar:0];
    case TARS_TYPE_INT1:
    return [NSNumber numberWithChar:[self readInt1]];
    case TARS_TYPE_INT2:
    return [NSNumber numberWithShort:[self readInt2]];
    case TARS_TYPE_INT4:
    return [NSNumber numberWithInt:[self readInt4]];
    case TARS_TYPE_INT8:
    return [NSNumber numberWithLongLong:[self readInt8]];
    case TARS_TYPE_FLOAT:
    return [NSNumber numberWithFloat:[self readFloat]];
    case TARS_TYPE_DOUBLE:
    return [NSNumber numberWithDouble:[self readDouble]];
    default:
    assert(0);
    break;
    }
    }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant