This is an archive of the discontinued LLVM Phabricator instance.

Fix crash when serializing ObjCIvarDecl.
Needs ReviewPublic

Authored by yiding on Jun 20 2014, 6:21 PM.

Details

Reviewers
akyrtzi
Summary

r198432 refactors ObjCIvarDecl such that it no longer serializes
BackingIvarReferencedInAccessor. However, it failed to remove
the field in the corresponding record abbrev. This causes assertion to
trip, or stack overflow/crash when asserts are disabled.

This was discovered when I attempted to use clang_saveTranslationUnit
and received a stack overflow.

Diff Detail

Event Timeline

yiding updated this revision to Diff 10715.Jun 20 2014, 6:21 PM
yiding retitled this revision from to Fix crash when serializing ObjCIvarDecl..
yiding updated this object.
yiding edited the test plan for this revision. (Show Details)
yiding added a reviewer: akyrtzi.
yiding added a subscriber: Unknown Object (MLST).Jun 20 2014, 6:22 PM
akyrtzi edited edge metadata.Jun 20 2014, 6:33 PM

Could you also add a test case ? See tests that invoke ‘c-index-test -write-pch …’, this calls clang_saveTranslationUnit.

Other than that LGTM, thank you!

yiding updated this revision to Diff 10717.Jun 20 2014, 6:58 PM
yiding edited edge metadata.

add a test

In r211438, thanks!