[llvm-commits] [dragonegg] r137815 - /dragonegg/trunk/src/Convert.cpp
Duncan Sands
baldrick at free.fr
Tue Aug 16 23:21:23 PDT 2011
Author: baldrick
Date: Wed Aug 17 01:21:23 2011
New Revision: 137815
URL: http://llvm.org/viewvc/llvm-project?rev=137815&view=rev
Log:
Fix thinko: GetFieldIndex returns INT_MAX if there is no such index,
not INT_MIN.
Modified:
dragonegg/trunk/src/Convert.cpp
Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=137815&r1=137814&r2=137815&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Wed Aug 17 01:21:23 2011
@@ -1456,7 +1456,7 @@
return TooCostly;
// If there is no corresponding LLVM field then something funky is going
// on - just give up.
- if (GetFieldIndex(Field, Ty) == INT_MIN)
+ if (GetFieldIndex(Field, Ty) == INT_MAX)
return TooCostly;
TotalCost += CostOfAccessingAllElements(TREE_TYPE(Field));
if (TotalCost >= TooCostly)
@@ -1504,7 +1504,7 @@
for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field)) {
// Get the address of the field.
int FieldIdx = GetFieldIndex(Field, Ty);
- assert(FieldIdx != INT_MIN && "Should not be copying if no LLVM field!");
+ assert(FieldIdx != INT_MAX && "Should not be copying if no LLVM field!");
Value *DestFieldPtr = Builder.CreateStructGEP(DestLoc.Ptr, FieldIdx);
Value *SrcFieldPtr = Builder.CreateStructGEP(SrcLoc.Ptr, FieldIdx);
@@ -1598,7 +1598,7 @@
for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field)) {
// Get the address of the field.
int FieldIdx = GetFieldIndex(Field, Ty);
- assert(FieldIdx != INT_MIN && "Should not be zeroing if no LLVM field!");
+ assert(FieldIdx != INT_MAX && "Should not be zeroing if no LLVM field!");
Value *FieldPtr = Builder.CreateStructGEP(DestLoc.Ptr, FieldIdx);
// Compute the field's alignment.
More information about the llvm-commits
mailing list