Skip to content

Commit 129c5ba

Browse files
committed
Remove some largely-dead error handling.
The runtime does not claim to work in memory-exhaustion cases and doing checks *sometimes* is worse than doing them all the time, especially when the checks are wrong.
1 parent 59f69a6 commit 129c5ba

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

selector_table.cc

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -484,22 +484,13 @@ SEL objc_register_selector_copy(UnregisteredSelector &aSel, BOOL copyArgs)
484484
else
485485
{
486486
copy->name = strdup(aSel.name);
487-
if (copy->name == nullptr)
488-
{
489-
fprintf(stderr, "Failed to allocate memory for selector %s\n", aSel.name);
490-
abort();
491-
}
492487
assert(copy->name);
493488
selector_name_copies += strlen(copy->name);
494489
}
495490
if (copy->types != nullptr)
496491
{
497492
copy->types = strdup(copy->types);
498-
if (copy->name == nullptr)
499-
{
500-
fprintf(stderr, "Failed to allocate memory for selector %s\n", aSel.name);
501-
abort();
502-
}
493+
assert(copy->types);
503494
selector_name_copies += strlen(copy->types);
504495
}
505496
}

0 commit comments

Comments
 (0)