Commit 240b183
committed
[lldb] Handle a byte size of zero in CompilerType::GetValueAsScalar (llvm#123107)
A bit or byte size of 0 is not a bug. It can legitimately (and
frequently) happen in Swift and C, just not in C++. However, it doesn't
make sense to read a scalar of zero bytes.
Currently, when this happens, we trigger an `lldb_assert` in the data
extractor and return 0, which isn't accurate. I have a bunch of reports
of the assert triggering, but nobody has been able to provide me with a
reproducer that I can turn into a test and I wasn't able to concoct a
test case by reverse-engineering the code.
rdar://141630334
(cherry picked from commit 8965dd4)1 parent 14c8403 commit 240b183
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1119 | 1119 | | |
1120 | 1120 | | |
1121 | 1121 | | |
1122 | | - | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
1123 | 1125 | | |
| 1126 | + | |
1124 | 1127 | | |
1125 | 1128 | | |
1126 | 1129 | | |
| |||
0 commit comments