carbon-language/carbon-lang

Invalid parse tree generated

Open

#7.247 geöffnet am 21. Mai 2026

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (1.535 Forks)batch import
good first issuetoolchain

Repository-Metriken

Stars
 (33.701 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 3T 6h) (129 gemergte PRs in 30 T)

Beschreibung

What did you do, or what's a simple way to reproduce the bug?

echo 'fn{p>fn()}' > /tmp/fuzz.carbon
bazel run -c dbg //toolchain -- compile --phase=parse /tmp/fuzz.carbon

What did you expect to happen?

Diagnostics reported, and completing without crashing.

What actually happened?

FATAL failure at toolchain/parse/parse.cpp:68: Invalid tree returned by Parse(): NodeId #nodeA couldn't be extracted as a FunctionDefinition. Trace:
Aggregate N6Carbon5Parse18FunctionDefinitionE: begin
Vector: begin
NodeIdInCategory Decl|Statement: kind ExprStatement consumed
NodeIdInCategory Decl|Statement error: kind IdentifierNameExpr doesn't match
Vector: end
NodeIdForKind error: wrong kind IdentifierNameExpr, expected FunctionDefinitionStart
Aggregate N6Carbon5Parse18FunctionDefinitionE: error
Error: IdentifierNameExpr node left unconsumed.

Any other information, logs, or outputs that you want to share?

The checking of the produce parse tree does not occur in an -c opt build.

This issue was found by fuzzing.

Contributor Guide