This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Fix for PR50741
ClosedPublic

Authored by chrish_ericsson_atx on Jun 16 2021, 3:18 PM.

Details

Summary

Fixed crash when doing pointer math on a void pointer.

Also, reworked test to use -verify rather than FileCheck.

Diff Detail

Event Timeline

chrish_ericsson_atx requested review of this revision.Jun 16 2021, 3:18 PM
chrish_ericsson_atx created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2021, 3:18 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
chrish_ericsson_atx edited the summary of this revision. (Show Details)Jun 16 2021, 3:27 PM

@erichkeane, can you please take a look?

erichkeane accepted this revision.Jun 16 2021, 4:46 PM

Two small changes to the test that you can do as a part of committing. Thanks!

clang/test/Sema/unbounded-array-bounds.c
17–19

Rather than actual line numbers, do @-1 here instead (you can do relative values). That way all of these are easy to read when going back through these.

80

As this warning is unrelated here, I'd suggest either casting this entire thing to (void) to suppress this, or just doing -Wno-unused on the command line flags.

This revision is now accepted and ready to land.Jun 16 2021, 4:46 PM
chrish_ericsson_atx edited the summary of this revision. (Show Details)

Addressed review feedback

erichkeane accepted this revision.Jun 17 2021, 7:15 AM

Yep, that works, still approved.

chrish_ericsson_atx marked 2 inline comments as done.Jun 17 2021, 7:15 AM

Thanks for the hints, @erichkeane ! Especially thanks for pointing out the root cause early on.

This revision was landed with ongoing or failed builds.Jun 17 2021, 7:17 AM
This revision was automatically updated to reflect the committed changes.