This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Fix crash when printing a struct with a static signed char member
ClosedPublic

Authored by DavidSpickett on Oct 4 2022, 9:01 AM.

Details

Summary

As with static bool for whatever reason printing them on their own
worked fine but wasn't handled when you printed the whole type.

I don't see a good way to test this from clang's side so our existing
tests will have to do.

We can now print all of the struct "A", so there's no need for a separate
one for static bool testing. I've not checked the output, just that it
succeeds. This saves us having to handle different min/max between systems.

Depends on D135169

Diff Detail

Event Timeline

DavidSpickett created this revision.Oct 4 2022, 9:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2022, 9:01 AM
DavidSpickett requested review of this revision.Oct 4 2022, 9:01 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 4 2022, 9:01 AM
aeubanks accepted this revision.Oct 4 2022, 9:57 AM
This revision is now accepted and ready to land.Oct 4 2022, 9:57 AM
shafik accepted this revision.Oct 5 2022, 5:07 PM
shafik added a subscriber: shafik.

LGTM

lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
39

We use signed char for the max case but char for the min case. Maybe we need a max using char and a min using signed char.

DavidSpickett added inline comments.Oct 6 2022, 2:20 AM
lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
39

I'll look into this.

This revision was landed with ongoing or failed builds.Oct 7 2022, 2:11 AM
This revision was automatically updated to reflect the committed changes.