This is an archive of the discontinued LLVM Phabricator instance.

llvm-undname: Add a -raw-input flag to pass a raw buffer to microsoftDemangle
ClosedPublic

Authored by thakis on Apr 16 2019, 5:34 AM.

Details

Summary

The default handling splits input into lines. Since
llvm-microsoft-demangle-fuzzer doesn't do this, oss-fuzz produces inputs
that only trigger crashes if the input isn't split into lines. This adds
a hidden flag -raw-input which passes input to microsoftDemangle() in
the same way the fuzzer does, for reproducing oss-fuzz reports.

Also change llvm-undname to have a non-0 exit code for invalid symbols.

Diff Detail

Repository
rL LLVM

Event Timeline

thakis created this revision.Apr 16 2019, 5:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 16 2019, 5:34 AM
hans accepted this revision.Apr 16 2019, 5:41 AM

lgtm

llvm/tools/llvm-undname/llvm-undname.cpp
34 ↗(On Diff #195357)

when I saw "raw-input" it wasn't immediately clear to me it would refer to a filename and not just take the input as an argument

not sure if that matters at all, or if it could be named to reflect that somehow. just a thought.

This revision is now accepted and ready to land.Apr 16 2019, 5:41 AM
thakis marked an inline comment as done.Apr 16 2019, 5:48 AM
thakis added inline comments.
llvm/tools/llvm-undname/llvm-undname.cpp
34 ↗(On Diff #195357)

Renamed to -raw-file, is that better?

This revision was automatically updated to reflect the committed changes.
hans added inline comments.Apr 16 2019, 6:01 AM
llvm/tools/llvm-undname/llvm-undname.cpp
34 ↗(On Diff #195357)

Yes, that's great. Thanks!