Closed
Description
Analyze this (incorrect) program with --strong
:
void method(dynamic/*=T extends Uri*/ t) {}
Observe that the analyzer freezes until it eventually runs out of memory and crashes. Be sad.
I looked into it a little bit. When the generic method comment is inserted into the token stream, the original comment remains. So the first time the comment is handled, you end up with something like:
void method(dynamic T extends Uri /*=T extends Uri*/ t) {}
Then it fails to parse the extends...
. At some point, it ends up retrying and hits the comment again:
void method(dynamic T extends Uri T extends Uri /*=T extends Uri*/ t) {}
Or something along those lines. I'm not sure why it keeps hitting the same code path again and again, but the result is an infinite expansion in the token stream.