Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swc_css_parser stuck freeze and cause memory leak when compile quoted class name in :global #8770

Open
stormslowly opened this issue Mar 21, 2024 · 2 comments
Labels
Milestone

Comments

@stormslowly
Copy link
Contributor

Describe the bug

when compile the code bellow, program freezed and consuming lots memory.
image
after change :global('.b') -> :global(.b), there is no error.

the instrument result shows the loop causes lot of memory
image

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

@alexander-akait
Copy link
Collaborator

Try to write:

.a {
  :global(.b) {
    color: red;
  }
}

@stormslowly
Copy link
Contributor Author

i know that, it should report wrong syntax, but not stuck the whole program.

@kdy1 kdy1 added this to the Planned milestone Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants