From 75ccd07c2fb942c51d84abc0bb418eae61579f9f Mon Sep 17 00:00:00 2001 From: Bruno Postle Date: Sun, 19 Jul 2026 21:46:55 +0100 Subject: [PATCH] fuzz: correct stale comment about lazy parsing in ifcparse fuzzer Construction of IfcFile already tokenizes, type-checks, and resolves every attribute of every instance, so toString() isn't what makes tokenizer/argument bugs reachable. --- src/ifcfuzz/ifcparse_fuzzer.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ifcfuzz/ifcparse_fuzzer.cpp b/src/ifcfuzz/ifcparse_fuzzer.cpp index 82cca6a680..e7075b1288 100644 --- a/src/ifcfuzz/ifcparse_fuzzer.cpp +++ b/src/ifcfuzz/ifcparse_fuzzer.cpp @@ -38,11 +38,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { IfcParse::IfcFile file(const_cast(static_cast(data)), static_cast(size)); if (file.good()) { - // IfcOpenShell parses lazily: merely constructing IfcFile only - // tokenizes the header and indexes instance byte offsets. - // toString() forces every attribute of every instance to be - // fully parsed, which is where most tokenizer/argument bugs - // would actually be reachable. + // Constructing IfcFile already tokenizes and type-checks every + // attribute of every instance (and resolves references), so + // most tokenizer/argument bugs are reachable without going any + // further. toString() is still exercised here since + // reserialization walks a different code path and may surface + // additional faults. std::ostringstream discard; for (const auto& entity : file) { try {