diff --git a/IDEHelper/COFF.cpp b/IDEHelper/COFF.cpp index b9b29892..d7af7aaa 100644 --- a/IDEHelper/COFF.cpp +++ b/IDEHelper/COFF.cpp @@ -850,7 +850,7 @@ void COFF::CvParseMembers(DbgType* parentType, int tagIdx, bool ipi) // if (!parentType->mBaseTypes.IsEmpty()) // parentType->mTypeParam = baseTypeEntry->mBaseType; // } - + parentType->mBaseTypes.PushBack(baseTypeEntry); parentType->mAlign = std::max(parentType->mAlign, baseTypeEntry->mBaseType->GetAlign()); @@ -1529,7 +1529,7 @@ DbgType* COFF::CvParseType(int tagIdx, bool ipi) baseType = CvGetType(classInfo.derived); BP_ALLOC_T(DbgBaseTypeEntry); DbgBaseTypeEntry* baseTypeEntry = mAlloc.Alloc(); - baseTypeEntry->mBaseType = baseType; + baseTypeEntry->mBaseType = baseType; dbgType->mBaseTypes.PushBack(baseTypeEntry); } diff --git a/IDEHelper/DbgExprEvaluator.cpp b/IDEHelper/DbgExprEvaluator.cpp index 26a22e23..4ea3264e 100644 --- a/IDEHelper/DbgExprEvaluator.cpp +++ b/IDEHelper/DbgExprEvaluator.cpp @@ -4705,6 +4705,13 @@ void DbgExprEvaluator::Visit(BfIndexerExpression* indexerExpr) } } + if ((collection.mType->IsBfObjectPtr()) || (collection.mType->IsStruct())) + { + // This should have been handled by some other cases + mResult = DbgTypedValue(); + Fail(StrFormat("Unable to index type '%s'", TypeToString(collection.mType).c_str()), indexerExpr->mOpenBracket); + } + auto memberType = collection.mType->mTypeParam; auto result = ReadTypedValue(memberType, target + indexArgument.GetInt64() * memberType->GetStride(), DbgAddrType_Target); if (mResult.mIsReadOnly) diff --git a/IDEHelper/DbgModule.cpp b/IDEHelper/DbgModule.cpp index 1cb94890..164b1632 100644 --- a/IDEHelper/DbgModule.cpp +++ b/IDEHelper/DbgModule.cpp @@ -1057,10 +1057,23 @@ bool DbgType::IsValueType() bool DbgType::IsTypedPrimitive() { + PopulateType(); + if (mTypeCode != DbgType_Struct) return false; - return mTypeParam != NULL; + if (mTypeParam != NULL) + return true; + + auto baseType = GetBaseType(); + if (baseType == NULL) + return false; + + if (!baseType->IsTypedPrimitive()) + return false; + + mTypeParam = baseType->mTypeParam; + return true; } bool DbgType::IsBoolean() @@ -2140,9 +2153,9 @@ DbgModule::DbgModule(DebugTarget* debugTarget) : mDefaultCompileUnit(this) CREATE_PRIMITIVE(DbgType_RawText, "@RawText", "@RawText", "@RawText", bool); CREATE_PRIMITIVE(DbgType_RegGroup, "@RegGroup", "@RegGroup", "@RegGroup", void*); - - CREATE_PRIMITIVE_C(DbgType_i8, "int16_t", int16_t); - CREATE_PRIMITIVE_C(DbgType_i8, "int32_t", int32_t); + + CREATE_PRIMITIVE_C(DbgType_i16, "int16_t", int16_t); + CREATE_PRIMITIVE_C(DbgType_i32, "int32_t", int32_t); CREATE_PRIMITIVE_C(DbgType_i64, "__int64", int64); CREATE_PRIMITIVE_C(DbgType_u64, "unsigned __int64", uint64); diff --git a/IDEHelper/Tests/BeefSpace.toml b/IDEHelper/Tests/BeefSpace.toml index 7bf3c755..c443adf2 100644 --- a/IDEHelper/Tests/BeefSpace.toml +++ b/IDEHelper/Tests/BeefSpace.toml @@ -28,6 +28,7 @@ COptimizationLevel = "O2" ConfigSelections = {TestsB = {Config = "Test"}} [Configs.Test.Win32] +IntermediateType = "ObjectAndIRCode" ConfigSelections = {TestsB = {Config = "Test"}} [Configs.TestFail.Win64]