Page MenuHomePhabricator

[analyzer] Don't crash when the code tries to construct an Objective-C object in AllocaRegion.

Authored by NoQ on Jun 2 2017, 6:21 AM.



The analyzer crashes when the user tries to allocate stack memory through alloca() and then construct an Objective-C object in it. The alloca() function is handled in the analyzer by its own concrete untyped memory region, AllocaRegion, which doesn't contain any clues on what type it might carry (because there are none). getDynamicTypeInfo() therefore ignores it unless a specific type info is already available.

To think: maybe we could pickup some dynamic type info from the implicit cast. We don't always have an implicit cast though.

Diff Detail


Event Timeline

NoQ created this revision.Jun 2 2017, 6:21 AM
NoQ updated this revision to Diff 101401.Jun 5 2017, 7:01 AM

Turn the comment into an assertion.

zaks.anna accepted this revision.Jun 5 2017, 9:14 AM
This revision is now accepted and ready to land.Jun 5 2017, 9:14 AM
This revision was automatically updated to reflect the committed changes.