Page MenuHomePhabricator

Allow CaseStmt to be initialized with a SubStmt

Authored by xazax.hun on Oct 28 2016, 4:16 PM.



The CaseStmt constructor now takes an optional SubStmt argument to initialize its SubExprs field with. This fixes an issue where the ASTImporter was constructing a CaseStmt and not setting its SubStmt member, causing a null pointer access when the SubStmt is accessed in the Stmt::stripLabelLikeStatements() function.

Diff Detail

Event Timeline

khazem updated this revision to Diff 76268.Oct 28 2016, 4:16 PM
khazem retitled this revision from to Allow CaseStmt to be initialized with a SubStmt.
khazem updated this object.
khazem added subscribers: phosek, cfe-commits, smklein.
khazem updated this revision to Diff 76272.Oct 28 2016, 4:24 PM

(added more context)

Add a test


I don't think you need this new param. You can create an instance if CaseStmt, then call setSubStmt() and after that return this instance.

xazax.hun commandeered this revision.Oct 25 2017, 2:29 AM
xazax.hun edited reviewers, added: khazem; removed: xazax.hun.
xazax.hun abandoned this revision.Oct 25 2017, 2:31 AM

Since r316069 this is no longer relevant.