[llvm-commits] [llvm-gcc-4.0] r42188 - /llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
Duncan Sands
baldrick at free.fr
Fri Sep 21 07:30:47 PDT 2007
Author: baldrick
Date: Fri Sep 21 09:30:46 2007
New Revision: 42188
URL: http://llvm.org/viewvc/llvm-project?rev=42188&view=rev
Log:
If TYPE_SIZE is null (in which case we almost certainly
never get here), then bail out conservatively rather than
optimistically. Likewise if TYPE_SIZE is negative.
Modified:
llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-types.cpp?rev=42188&r1=42187&r2=42188&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Fri Sep 21 09:30:46 2007
@@ -536,13 +536,14 @@
// If the type does not overlap, don't bother checking below.
if (!TYPE_SIZE(type))
- return false;
+ // C-style variable length array? Be conservative.
+ return true;
- if (!isInt64(TYPE_SIZE(type), false))
- // Variable sized or huge - be conservative.
+ if (!isInt64(TYPE_SIZE(type), true))
+ // Negative size (!) or huge - be conservative.
return true;
- if (!getInt64(TYPE_SIZE(type), false) ||
+ if (!getInt64(TYPE_SIZE(type), true) ||
PadStartBits >= (int64_t)getInt64(TYPE_SIZE(type), false) ||
PadStartBits+PadSizeBits <= 0)
return false;
More information about the llvm-commits
mailing list