Closed jamesnw closed 2 months ago
In some situations when using the Indented Syntax in Sass, deleting a } will cause an infinite loop.
}
To replicate:
a
{
I can consistently make the browser crash with these steps.
Chromium 128.0.6613.138
https://codemirror.net/try/?c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQge3Nhc3N9IGZyb20gIkBjb2RlbWlycm9yL2xhbmctc2FzcyIKCm5ldyBFZGl0b3JWaWV3KHsKICBkb2M6ICJhXG4gIGNvbG9yOiByZWQiLAogIGV4dGVuc2lvbnM6IFtiYXNpY1NldHVwLCBzYXNzKHtpbmRlbnRlZDogdHJ1ZX0pXSwKICBwYXJlbnQ6IGRvY3VtZW50LmJvZHkKfSkK
A careless use of a rule that could match a zero-length end-of-file token made the grammar loop. Attached patch fixes it.
Thanks for the quick fix!
Describe the issue
In some situations when using the Indented Syntax in Sass, deleting a
}
will cause an infinite loop.To replicate:
a
, type{
.}
}
.I can consistently make the browser crash with these steps.
Browser and platform
Chromium 128.0.6613.138
Reproduction link
https://codemirror.net/try/?c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQge3Nhc3N9IGZyb20gIkBjb2RlbWlycm9yL2xhbmctc2FzcyIKCm5ldyBFZGl0b3JWaWV3KHsKICBkb2M6ICJhXG4gIGNvbG9yOiByZWQiLAogIGV4dGVuc2lvbnM6IFtiYXNpY1NldHVwLCBzYXNzKHtpbmRlbnRlZDogdHJ1ZX0pXSwKICBwYXJlbnQ6IGRvY3VtZW50LmJvZHkKfSkK