ctu: fixed error locations

This commit is contained in:
Daniel Marjamäki 2019-09-12 19:20:13 +02:00
parent 4e076e1854
commit fc25fe83bd
1 changed files with 2 additions and 8 deletions

View File

@ -546,18 +546,12 @@ std::list<ErrorLogger::ErrorMessage::FileLocation> CTU::FileInfo::getErrorPath(I
std::copy(functionCall->callValuePath.cbegin(), functionCall->callValuePath.cend(), std::back_inserter(locationList)); std::copy(functionCall->callValuePath.cbegin(), functionCall->callValuePath.cend(), std::back_inserter(locationList));
} }
ErrorLogger::ErrorMessage::FileLocation fileLoc; ErrorLogger::ErrorMessage::FileLocation fileLoc(path[index]->location.fileName, path[index]->location.lineNumber, path[index]->location.column);
fileLoc.setfile(path[index]->location.fileName);
fileLoc.line = path[index]->location.lineNumber;
fileLoc.column = path[index]->location.column;
fileLoc.setinfo("Calling function " + path[index]->callFunctionName + ", " + MathLib::toString(path[index]->callArgNr) + getOrdinalText(path[index]->callArgNr) + " argument is " + value1); fileLoc.setinfo("Calling function " + path[index]->callFunctionName + ", " + MathLib::toString(path[index]->callArgNr) + getOrdinalText(path[index]->callArgNr) + " argument is " + value1);
locationList.push_back(fileLoc); locationList.push_back(fileLoc);
} }
ErrorLogger::ErrorMessage::FileLocation fileLoc2; ErrorLogger::ErrorMessage::FileLocation fileLoc2(unsafeUsage.location.fileName, unsafeUsage.location.lineNumber, unsafeUsage.location.column);
fileLoc2.setfile(unsafeUsage.location.fileName);
fileLoc2.line = unsafeUsage.location.lineNumber;
fileLoc2.column = unsafeUsage.location.column;
fileLoc2.setinfo(replaceStr(info, "ARG", unsafeUsage.myArgumentName)); fileLoc2.setinfo(replaceStr(info, "ARG", unsafeUsage.myArgumentName));
locationList.push_back(fileLoc2); locationList.push_back(fileLoc2);