Skip to content

CFE parsing of spreads/control-flow collections #38874

@aartbik

Description

@aartbik

DartFuzz follows the grammar of the "CFE Implementation" document to generate arbitrary list and map expressions with spreads and control flow collection elements. For shallow expressions this works well, but for deeper expression the CFE gets all kinds of parsing problems.

See several examples attached.

Please have a look if this is a generating grammar issue, or a true parsing bug.

fuzz.dart:59:427: Error: Expected ':' after this.
Map<int, String> var44 = {...{for (int loc0 = 0; loc0 < 1; loc0++) ...{-66 : '\u{1f600}wV\u2665e', for (int loc1 = 0; loc1 < 12; loc1++) -70 : '9'}, ...{...{2 : 'rr\u2665'}, ...{9223372032559808512 : '-N', 24 : '7('}, if (true) 18 : '\u{1f600}!@D' else 7 : 'JV@qyM'}, if (false) ...{if (true) 28 : '4c(CO5' else 2147483649 : 'p\u2665@', for (int loc0 = 0; loc0 < 7; loc0++) -83 : '33'}}, if (true) -69 : 'Pv4\u{1f600}&#' else for (int loc0 = 0; loc0 < 8; loc0++) ...{for (int loc1 in [-13, -95]) 13 : 'Q\u2665Pg', ...{23 : 'n4\u2665'}, if (true) 1 : 'ba' else 31 : '\u2665g&&dIN'}, if (true) ...{5 : 'O)'} else ...{10 : '\u2665Xuz\u{1f600}'}, if (false) if (true) for (int loc0 = 0; loc0 < 8; loc0++) ...{-4 : '\u2665J'} else -57 : ' p9', for (int loc0 in {4294967296, 14, ...{-36, for (int loc1 = 0; loc1 < 11; loc1++) if (true) 47}}) if (false) ...{...{40 : '89w'}, 2147483647 : 'ZB0\u{1f600}'} else if (false) if (true) 29 : '' else -35 : 'PGt' else 9223372034707292161 : '6qM3sfQ'};
                                                                                                                                                                                                                                                                                                                                                                                                                                          ^
fuzz.dart:59:665: Error: Expected ':' after this.
Map<int, String> var44 = {...{for (int loc0 = 0; loc0 < 1; loc0++) ...{-66 : '\u{1f600}wV\u2665e', for (int loc1 = 0; loc1 < 12; loc1++) -70 : '9'}, ...{...{2 : 'rr\u2665'}, ...{9223372032559808512 : '-N', 24 : '7('}, if (true) 18 : '\u{1f600}!@D' else 7 : 'JV@qyM'}, if (false) ...{if (true) 28 : '4c(CO5' else 2147483649 : 'p\u2665@', for (int loc0 = 0; loc0 < 7; loc0++) -83 : '33'}}, if (true) -69 : 'Pv4\u{1f600}&#' else for (int loc0 = 0; loc0 < 8; loc0++) ...{for (int loc1 in [-13, -95]) 13 : 'Q\u2665Pg', ...{23 : 'n4\u2665'}, if (true) 1 : 'ba' else 31 : '\u2665g&&dIN'}, if (true) ...{5 : 'O)'} else ...{10 : '\u2665Xuz\u{1f600}'}, if (false) if (true) for (int loc0 = 0; loc0 < 8; loc0++) ...{-4 : '\u2665J'} else -57 : ' p9', for (int loc0 in {4294967296, 14, ...{-36, for (int loc1 = 0; loc1 < 11; loc1++) if (true) 47}}) if (false) ...{...{40 : '89w'}, 2147483647 : 'ZB0\u{1f600}'} else if (false) if (true) 29 : '' else -35 : 'PGt' else 9223372034707292161 : '6qM3sfQ'};

Metadata

Metadata

Assignees

Labels

dartfuzzFound with Dart fuzzing (DartFuzz, libFuzzer, etc.)legacy-area-front-endLegacy: Use area-dart-model instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions