This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Avoid using a null type pointer (fixes PR32750)
ClosedPublic

Authored by vsk on Apr 25 2017, 9:58 PM.

Details

Summary

isMicrosoftMissingTypename() uses a Type pointer without first checking
that it's non-null. PR32750 reports a case where the pointer is in fact
null. This patch adds in a defensive check and a regression test.

Diff Detail

Repository
rL LLVM

Event Timeline

vsk created this revision.Apr 25 2017, 9:58 PM
nikola accepted this revision.Apr 25 2017, 10:13 PM

LGTM

test/SemaCXX/MicrosoftExtensions.cpp
516 ↗(On Diff #96668)

nitpick: you don't need the space between angle brackets since you set the standard to C++14, I'm not sure what the convention here is but you don't need more than C++11...

This revision is now accepted and ready to land.Apr 25 2017, 10:13 PM
vsk added inline comments.Apr 26 2017, 8:49 AM
test/SemaCXX/MicrosoftExtensions.cpp
516 ↗(On Diff #96668)

Thanks for taking a look! I'll fix this up before committing.

This revision was automatically updated to reflect the committed changes.