Skip to content

Commit

Permalink
Issue #3239: Remove errorneous error reporting
Browse files Browse the repository at this point in the history
Apparently, it's possible that the start and end file of a VObject token
are different. One such case is when a include file is in the middle of
a module declaration.

Known Issue: VObject still needs to track the end file but there's only
one PathId member which is tracking the start file. Something to follow
up on.
  • Loading branch information
hs-apotell committed Sep 25, 2022
1 parent b310b70 commit 1041c9b
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/Design/FileContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,18 +677,23 @@ void FileContent::populateCoreMembers(NodeId startIndex, NodeId endIndex,
}

PathId fileId;
if (startIndex && endIndex) {
const VObject& startObject = m_objects[startIndex];
const VObject& endObject = m_objects[endIndex];
if (startObject.m_fileId == endObject.m_fileId) {
fileId = startObject.m_fileId;
} else {
Location loc(m_fileId);
Error err(ErrorDefinition::COMP_INTERNAL_ERROR_OUT_OF_BOUND, loc);
m_errors->addError(err);
std::cerr << "\nFILE INDEX MISMATCH\n\n";
}
} else if (startIndex) {
// Issue #3239: Apparently, it's possible that startIndex.m_fileId
// & endIndex.m_fileId are differently (for example, including a file
// in the middle of a module declaration).
//
// if (startIndex && endIndex) {
// const VObject& startObject = m_objects[startIndex];
// const VObject& endObject = m_objects[endIndex];
// if (startObject.m_fileId == endObject.m_fileId) {
// fileId = startObject.m_fileId;
// } else {
// Location loc(m_fileId);
// Error err(ErrorDefinition::COMP_INTERNAL_ERROR_OUT_OF_BOUND, loc);
// m_errors->addError(err);
// std::cerr << "\nFILE INDEX MISMATCH\n\n";
// }
// } else
if (startIndex) {
const VObject& object = m_objects[startIndex];
fileId = object.m_fileId;
} else if (endIndex) {
Expand Down

0 comments on commit 1041c9b

Please sign in to comment.