This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Remove crashing unneeded assert
ClosedPublic

Authored by george.karpenkov on Jan 31 2018, 5:45 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ added a comment.Feb 1 2018, 12:02 PM

This one is really weird. Any node can cache out, regardless of program point types.

However, it documents how the code works: if the number of predecessors is not equal to 1, the ascension through predecessors is not necessarily working correctly.

I think we should keep it until we are ready to provide an actual broken example, and then see how can this code be fixed. There must be something in the program state that should keep these branches apart (and these nodes from caching out). And since there is something in the program state, we should extend it to contain whatever we need here, so that we didn't need to ascend.

@NoQ a short reproducer is:

typedef struct { char a; } b;
int c(b* input) {
    return (input->a ?: input) ? 1 : 0;
}

Tracked in rdar://37540480

NoQ accepted this revision.Feb 16 2018, 6:44 PM

All right, so it sounds like it still needs to be investigated, but at least we've made one more step with a brand-new reproducer.

This revision is now accepted and ready to land.Feb 16 2018, 6:44 PM
This revision was automatically updated to reflect the committed changes.