Page MenuHomePhabricator

[analyzer] Fix yet-another-crash in body-farming std::call_once
ClosedPublic

Authored by george.karpenkov on Jan 31 2018, 6:33 PM.

Details

Summary

Crash occurs when parameters to the callback and to std::call_once mismatch, and C++ is supposed to auto-construct an argument.

Filed by Alexander Kornienko in https://bugs.llvm.org/show_bug.cgi?id=36149

rdar://37034403

Diff Detail

Repository
rC Clang

Event Timeline

This seems reasonable to me.

@NoQ can you take a close look at this too?

NoQ accepted this revision.Feb 1 2018, 11:37 AM

Yep, looks great.

test/Analysis/call_once.cpp
382

Could you add a more explicit TODO/FIXME, a no-crash where there used to be the crash, and maybe a bit of background for what this test tests? Cause recently i've been reading a lot of tests that i don't understand :)

This revision is now accepted and ready to land.Feb 1 2018, 11:37 AM
NoQ added inline comments.Feb 1 2018, 11:37 AM
lib/Analysis/BodyFarm.cpp
425–426

Actually, this should probably go after the check?

Less intrusive patch.

george.karpenkov marked an inline comment as done.
This revision was automatically updated to reflect the committed changes.