mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
Teach DataLayout that zero-byte pointer sizes don't make sense.
Previously this would result in assertion failures or simply crashes at various points in the optimizer when trying to create types of zero bit width. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230936 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -259,6 +259,8 @@ void DataLayout::parseSpecifier(StringRef Desc) {
|
||||
"Missing size specification for pointer in datalayout string");
|
||||
Split = split(Rest, ':');
|
||||
unsigned PointerMemSize = inBytes(getInt(Tok));
|
||||
if (!PointerMemSize)
|
||||
report_fatal_error("Invalid pointer size of 0 bytes");
|
||||
|
||||
// ABI alignment.
|
||||
if (Rest.empty())
|
||||
|
Reference in New Issue
Block a user