From 5b71e2ef817b1c64da3f9581baff687058e9e042 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sun, 26 Apr 2009 11:29:30 +0200 Subject: [PATCH] Fix interface indices. Closes #269 and #266. --- ir/irtypeclass.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ir/irtypeclass.cpp b/ir/irtypeclass.cpp index 92d4dccb..c1aedb77 100644 --- a/ir/irtypeclass.cpp +++ b/ir/irtypeclass.cpp @@ -265,10 +265,11 @@ void IrTypeClass::addInterfaceToMap(ClassDeclaration * inter, size_t index) // add this interface interfaceMap.insert(std::make_pair(inter, index)); - // add all its base interfaces recursively - for (size_t i = 0; i < inter->interfaces_dim; i++) + // add the direct base interfaces recursively - they + // are accessed through the same index + if (inter->interfaces_dim > 0) { - BaseClass* b = inter->interfaces[i]; + BaseClass* b = inter->interfaces[0]; addInterfaceToMap(b->base, index); } }