| 170 | } |
| 171 | |
| 172 | DbgTypedValue DbgEvaluationContext::EvaluateInContext(DbgTypedValue contextTypedValue) |
| 173 | { |
| 174 | if (mExprNode == NULL) |
| 175 | return DbgTypedValue(); |
| 176 | mPassInstance->ClearErrors(); |
| 177 | if (contextTypedValue) |
| 178 | { |
| 179 | mDbgExprEvaluator->mExplicitThis = contextTypedValue; |
| 180 | if ((mDbgExprEvaluator->mExplicitThis.mType->IsPointer()) && (mDbgExprEvaluator->mExplicitThis.mType->mTypeParam->WantsRefThis())) |
| 181 | { |
| 182 | mDbgExprEvaluator->mExplicitThis.mType = mDbgExprEvaluator->mExplicitThis.mType->mTypeParam; |
| 183 | mDbgExprEvaluator->mExplicitThis.mSrcAddress = mDbgExprEvaluator->mExplicitThis.mPtr; |
| 184 | mDbgExprEvaluator->mExplicitThis.mPtr = 0; |
| 185 | } |
| 186 | |
| 187 | if ((mDbgExprEvaluator->mExplicitThis.mType->IsCompositeType()) && (!mDbgExprEvaluator->mExplicitThis.mType->WantsRefThis())) |
| 188 | { |
| 189 | if (mDbgExprEvaluator->mExplicitThis.mSrcAddress != 0) |
| 190 | { |
| 191 | mDbgExprEvaluator->mExplicitThis.mType = mDbgExprEvaluator->mDbgModule->GetPointerType(mDbgExprEvaluator->mExplicitThis.mType); |
| 192 | mDbgExprEvaluator->mExplicitThis.mPtr = mDbgExprEvaluator->mExplicitThis.mSrcAddress; |
| 193 | mDbgExprEvaluator->mExplicitThis.mSrcAddress = 0; |
| 194 | } |
| 195 | } |
| 196 | } |
| 197 | if (contextTypedValue.mType != NULL) |
| 198 | mDbgExprEvaluator->mDbgCompileUnit = contextTypedValue.mType->mCompileUnit; |
| 199 | DbgTypedValue exprResult; |
| 200 | auto result = mDbgExprEvaluator->Resolve(mExprNode); |
| 201 | return result; |
| 202 | } |
| 203 | |
| 204 | bool DbgEvaluationContext::HadError() |
| 205 | { |
no test coverage detected