This is an archive of the discontinued LLVM Phabricator instance.

DebugInfo: Fix null dereference on null DISubroutineType
Needs ReviewPublic

Authored by arsenm on Jan 17 2022, 6:48 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

No idea what I'm doing or if this is the right fix, a good test, or if
this metadata should fail the verifier. I've had this crashing
testcase sitting around for months so I'm not entirely sure where it
came from, but I think I was manually reducing the metadata.

Diff Detail

Event Timeline

arsenm created this revision.Jan 17 2022, 6:48 AM
arsenm requested review of this revision.Jan 17 2022, 6:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 17 2022, 6:48 AM
Herald added a subscriber: wdng. · View Herald Transcript

@aprantl - validator's more your wheelhouse than mine, but I'd say if we don't have a specific use case for this we should default to making it invalid/fail the verifier for now - can widen that if/when needed.

ormris removed a subscriber: ormris.Jan 18 2022, 9:38 AM

It surprises me that the assembler doesn't seem to require a type either. I think I agree with David that it would be better to let the Verifier fail here and require a type. For reference, this is how clang produces void():

!9 = distinct !DISubprogram(name: "f", scope: !10, file: !10, line: 1, type: !11, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !7)
!10 = !DIFile(filename: "/tmp/t.c", directory: "")
!11 = !DISubroutineType(types: !12)
!12 = !{null}
jryans added a project: debug-info.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2023, 9:19 AM