forked from BigfootDev/flatbuffers
disallow circular struct references (#8851)
* detect and fail for circular struct dependencies * pr comments * pr comment
This commit is contained in:
@@ -927,6 +927,9 @@ std::unique_ptr<Parser> FlatCompiler::GenerateCode(const FlatCOptions& options,
|
||||
auto err = parser->ConformTo(conform_parser);
|
||||
if (!err.empty()) Error("schemas don\'t conform: " + err, false);
|
||||
}
|
||||
if (parser->HasCircularStructDependency()) {
|
||||
Error("schema has circular struct dependencies: " + filename, false);
|
||||
}
|
||||
if (options.schema_binary || opts.binary_schema_gen_embed) {
|
||||
parser->Serialize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user