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

Crash when selector ends with escaped backslash and no whitespace #1855

Closed
connorskees opened this issue Dec 23, 2022 · 0 comments · Fixed by #1870
Closed

Crash when selector ends with escaped backslash and no whitespace #1855

connorskees opened this issue Dec 23, 2022 · 0 comments · Fixed by #1870
Assignees

Comments

@connorskees
Copy link
Contributor

connorskees commented Dec 23, 2022

dart-sass will crash on the following input:

\\{}
Stacktrace
Unexpected exception:
RangeError (end): Invalid value: Not in inclusive range 0..8: 9


dart:core                                               _StringBase.substring
package:sass/src/utils.dart 78                          trimAscii
package:sass/src/visitor/evaluate.dart 3153             _EvaluateVisitor._interpolationToValue
package:sass/src/visitor/evaluate.dart 1869             _EvaluateVisitor.visitStyleRule
package:sass/src/ast/sass/statement/style_rule.dart 30  StyleRule.accept
package:sass/src/visitor/evaluate.dart 938              _EvaluateVisitor.visitStylesheet
package:sass/src/visitor/evaluate.dart 746              _EvaluateVisitor._execute.<fn>
package:sass/src/visitor/evaluate.dart 3139             _EvaluateVisitor._withEnvironment
package:sass/src/visitor/evaluate.dart 716              _EvaluateVisitor._execute
package:sass/src/visitor/evaluate.dart 532              _EvaluateVisitor.run.<fn>
dart:async                                              runZoned
package:sass/src/evaluation_context.dart 57             withEvaluationContext
package:sass/src/visitor/evaluate.dart 525              _EvaluateVisitor.run
package:sass/src/visitor/evaluate.dart 97               evaluate
package:sass/src/compile.dart 151                       _compileStylesheet
package:sass/src/compile.dart 68                        compile
package:sass/src/executable/compile_stylesheet.dart 97  compileStylesheet
d:\a\dart-sass\dart-sass\bin\sass.dart 65               main
@connorskees connorskees changed the title Crash on selector with many backslashes Crash when selector ends with escaped backslash and no whitespace Dec 23, 2022
@jathak jathak self-assigned this Jan 10, 2023
jathak added a commit that referenced this issue Jan 17, 2023
jathak added a commit that referenced this issue Jan 17, 2023
jathak added a commit that referenced this issue Jan 25, 2023
* Fix escaped backslash crash

Fixes #1855.

* Code review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants