===================================================================
@@ -176,6 +176,7 @@ go/statements.o: go/statements.cc $(GO_S
$(GO_C_H) $(GO_TYPES_H) $(GO_EXPRESSIONS_H) $(GO_GOGO_H) \
$(GO_STATEMENTS_H)
go/types.o: go/types.cc $(GO_SYSTEM_H) intl.h $(TREE_H) $(GIMPLE_H) \
- $(REAL_H) $(GO_C_H) $(GO_GOGO_H) go/operator.h $(GO_EXPRESSIONS_H) \
- $(GO_STATEMENTS_H) go/export.h $(GO_IMPORT_H) $(GO_TYPES_H)
+ $(REAL_H) convert.h $(GO_C_H) $(GO_GOGO_H) go/operator.h \
+ $(GO_EXPRESSIONS_H) $(GO_STATEMENTS_H) go/export.h $(GO_IMPORT_H) \
+ $(GO_TYPES_H)
go/unsafe.o: go/unsafe.cc $(GO_SYSTEM_H) $(GO_TYPES_H) $(GO_GOGO_H)
===================================================================
@@ -16,6 +16,7 @@ extern "C"
#include "tree.h"
#include "gimple.h"
#include "real.h"
+#include "convert.h"
}
#include "go-c.h"
@@ -3438,7 +3439,9 @@ Array_type::get_length_tree(Gogo* gogo)
// Make up a translation context for the array length
// expression. FIXME: This won't work in general.
Translate_context context(gogo, NULL, NULL, NULL_TREE);
- this->length_tree_ = save_expr(this->length_->get_tree(&context));
+ tree len = this->length_->get_tree(&context);
+ len = convert_to_integer(integer_type_node, len);
+ this->length_tree_ = save_expr(len);
}
}
return this->length_tree_;