swc
swc copied to clipboard
swc_css_parser stuck freeze and cause memory leak when compile quoted class name in :global
Describe the bug
when compile the code bellow, program freezed and consuming lots memory.
after change :global('.b') -> :global(.b), there is no error.
the instrument result shows the loop causes lot of memory
Input code
.a {
:global('.b') {
color: red;
}
}
Config
No response
Playground link (or link to the minimal reproduction)
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=53cb34370e12c1c4640394b2ae207e5f
SWC Info output
No response
Expected behavior
compiles OK
Actual behavior
memory leak
Version
0.90.23
Additional context
No response
Try to write:
.a {
:global(.b) {
color: red;
}
}
i know that, it should report wrong syntax, but not stuck the whole program.