mirror of https://github.com/WerWolv/ImHex.git
Disallow using declarations with invalid or not yet declared types
This commit is contained in:
parent
4c07983834
commit
a2fb9306c7
|
@ -1,4 +1,4 @@
|
||||||
#include "parser/validator.hpp"
|
#include "lang/validator.hpp"
|
||||||
|
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -29,6 +29,9 @@ namespace hex::lang {
|
||||||
auto typeDeclNode = static_cast<ASTNodeTypeDecl*>(node);
|
auto typeDeclNode = static_cast<ASTNodeTypeDecl*>(node);
|
||||||
if (!typeNames.insert(typeDeclNode->getTypeName()).second)
|
if (!typeNames.insert(typeDeclNode->getTypeName()).second)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (typeDeclNode->getAssignedType() == Token::TypeToken::Type::CustomType && !typeNames.contains(typeDeclNode->getAssignedCustomTypeName()))
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ASTNode::Type::Struct:
|
case ASTNode::Type::Struct:
|
Loading…
Reference in New Issue