| 49 | ////////////////////////////////////////////////////////////////////////// |
| 50 | |
| 51 | void BfLocalVariable::Init() |
| 52 | { |
| 53 | if (mResolvedType->IsValuelessType()) |
| 54 | { |
| 55 | mAssignedKind = BfLocalVarAssignKind_Unconditional; |
| 56 | return; |
| 57 | } |
| 58 | |
| 59 | if (mAssignedKind != BfLocalVarAssignKind_None) |
| 60 | return; |
| 61 | |
| 62 | bool isStruct = mResolvedType->IsStruct(); |
| 63 | if (mResolvedType->IsRef()) |
| 64 | isStruct = mResolvedType->GetUnderlyingType()->IsStruct(); |
| 65 | |
| 66 | if ((isStruct) || ((mIsThis) && (mResolvedType->IsStructOrStructPtr()))) |
| 67 | { |
| 68 | auto resolvedTypeRef = mResolvedType; |
| 69 | if ((resolvedTypeRef->IsPointer()) || (resolvedTypeRef->IsRef())) |
| 70 | resolvedTypeRef = resolvedTypeRef->GetUnderlyingType(); |
| 71 | auto typeInstance = resolvedTypeRef->ToTypeInstance(); |
| 72 | mUnassignedFieldFlags = (1 << typeInstance->mMergedFieldDataCount) - 1; |
| 73 | if ((mIsThis) && (typeInstance->mBaseType != NULL)) |
| 74 | { |
| 75 | // Base ctor is responsible for initializing its own fields |
| 76 | mUnassignedFieldFlags &= ~(((int64)1 << typeInstance->mBaseType->mMergedFieldDataCount) - 1); |
| 77 | } |
| 78 | if (mUnassignedFieldFlags == 0) |
| 79 | mAssignedKind = BfLocalVarAssignKind_Unconditional; |
| 80 | } |
| 81 | else |
| 82 | { |
| 83 | mUnassignedFieldFlags = 1; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | BfLocalMethod::~BfLocalMethod() |
| 88 | { |
no test coverage detected