This is an archive of the discontinued LLVM Phabricator instance.

Fix crash when cu_comp_dir parameter to DWARFDebugLine::ParseSupportFiles() is an empty string
AbandonedPublic

Authored by ted on Jun 4 2015, 9:13 AM.

Details

Reviewers
clayborg
Summary

If cu_comp_dir is "", this will crash as it tries to access index -1:

fullpath = cu_comp_dir;

if (*fullpath.rbegin() != '/')

Diff Detail

Event Timeline

ted updated this revision to Diff 27127.Jun 4 2015, 9:13 AM
ted retitled this revision from to Fix crash when cu_comp_dir parameter to DWARFDebugLine::ParseSupportFiles() is an empty string.
ted updated this object.
ted edited the test plan for this revision. (Show Details)
ted added a reviewer: clayborg.
ted added a subscriber: Unknown Object (MLST).
clayborg accepted this revision.Jun 4 2015, 9:25 AM
clayborg edited edge metadata.

Looks good. I would also file a bug on the compiler that generated and empty DW_AT_comp_dir as this is just bad DWARF. Valid, but bad.

This revision is now accepted and ready to land.Jun 4 2015, 9:25 AM
ted abandoned this revision.Nov 23 2015, 12:34 PM

Handled by another patch