This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Fix crash in CheckStructUnionType()
AbandonedPublic

Authored by davide on Apr 27 2015, 5:59 PM.

Details

Summary

This is an attempt to fix the first half of the problem in https://llvm.org/bugs/show_bug.cgi?id=19002
We {co,sh}ould be able to override a union initializer with an empty initializer but the code doesn't deal with that (I think). I'm still relatively new to Sema so there might be something I'm missing.

I double checked the generated AST after the fix and it seems correct:
[...]

`-VarDecl 0x807d35000 <line:21:3, line:27:3> line:21:11 v 'union a [2]' cinit
  `-InitListExpr 0x807d35268 <col:18, line:27:3> 'union a [2]'
    |-array filler
    | `-ImplicitValueInitExpr 0x807d35310 <<invalid sloc>> 'union a':'union a'
    `-InitListExpr 0x807d352b8 <line:26:11, col:14> 'union a':'union a' field Field 0x807caac90 'f' 'int'

[...]

I'll take a look at the FIXME and add the testcase reported in the PR if this sounds reasonable to you.

Diff Detail

Event Timeline

davide updated this revision to Diff 24523.Apr 27 2015, 5:59 PM
davide retitled this revision from to [Sema] Fix crash in CheckStructUnionType().
davide updated this object.
davide edited the test plan for this revision. (Show Details)
davide added reviewers: rsmith, aaron.ballman.
davide set the repository for this revision to rL LLVM.
davide added a subscriber: Unknown Object (MLST).
rsmith edited edge metadata.Apr 27 2015, 6:16 PM

I'd like to put this on hold untli http://reviews.llvm.org/D5789 lands; it may also fix this case.

davide abandoned this revision.Jun 14 2015, 2:27 PM

r239446 fixes this case.