This is an archive of the discontinued LLVM Phabricator instance.

Avoid invalid string access in ObjCLanguage::MethodName::SetName
ClosedPublic

Authored by sas on Jun 2 2017, 3:22 PM.

Details

Summary

Don't access `name[1] if the string is only of length 1. Avoids a
crash/assertion failure when parsing the string -.

Test Plan:
Debug a swift binary, set a breakpoint, watch lldb not crash

Original change by Paul Menage <menage@fb.com>

Diff Detail

Repository
rL LLVM

Event Timeline

sas created this revision.Jun 2 2017, 3:22 PM
sas added a comment.Jun 5 2017, 10:44 AM

This seems like a fairly straightforward fix so I'll merge it.

This revision was automatically updated to reflect the committed changes.