Skip to content

fix(plugin/replace): handle backtrack limit exceeded error#2088

Merged
hyf0 merged 1 commit intomainfrom
08-29-fix_plugin_replace_handle_backtrack_limit_exceeded_error
Aug 29, 2024
Merged

fix(plugin/replace): handle backtrack limit exceeded error#2088
hyf0 merged 1 commit intomainfrom
08-29-fix_plugin_replace_handle_backtrack_limit_exceeded_error

Conversation

@hyf0
Copy link
Copy Markdown
Member

@hyf0 hyf0 commented Aug 29, 2024

Description

Solves #2056 (comment).

The cause is that fancy_regex will limit the times of doing backtrack. If reach limit, fancy_regex will throw a error. The continue in old code causes a infinite loop if there is error happed.

Copy link
Copy Markdown
Member Author

hyf0 commented Aug 29, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @hyf0 and the rest of your teammates on Graphite Graphite

@netlify
Copy link
Copy Markdown

netlify bot commented Aug 29, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 114e221
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/66d033d7b6f1d4000914cb74

@hyf0 hyf0 marked this pull request as ready for review August 29, 2024 08:38
@hyf0 hyf0 force-pushed the 08-29-fix_plugin_replace_handle_backtrack_limit_exceeded_error branch from 47b5246 to 114e221 Compare August 29, 2024 08:39
@hyf0 hyf0 requested a review from IWANABETHATGUY August 29, 2024 08:40
@hyf0 hyf0 enabled auto-merge August 29, 2024 08:41
@github-actions
Copy link
Copy Markdown
Contributor

Benchmarks Rust

  • target: main(aa5b528)
  • pr: 08-29-fix_plugin_replace_handle_backtrack_limit_exceeded_error(114e221)
group                                                               pr                                     target
-----                                                               --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol                     1.00     52.6±0.93ms        ? ?/sec    1.01     53.0±1.13ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-minify              1.01     79.0±1.36ms        ? ?/sec    1.00     78.1±0.74ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-minify-sourcemap    1.00     96.0±1.01ms        ? ?/sec    1.00     95.8±1.31ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap           1.00     61.0±0.74ms        ? ?/sec    1.00     61.3±1.48ms        ? ?/sec
bundle/bundle@rome-ts                                               1.00    101.9±0.99ms        ? ?/sec    1.01    102.9±1.82ms        ? ?/sec
bundle/bundle@rome-ts-minify                                        1.03    191.1±4.55ms        ? ?/sec    1.00    185.7±3.35ms        ? ?/sec
bundle/bundle@rome-ts-minify-sourcemap                              1.01    233.6±6.24ms        ? ?/sec    1.00    231.5±3.28ms        ? ?/sec
bundle/bundle@rome-ts-sourcemap                                     1.00    117.7±1.07ms        ? ?/sec    1.00    118.1±0.97ms        ? ?/sec
bundle/bundle@threejs                                               1.00     36.4±1.42ms        ? ?/sec    1.03     37.5±0.35ms        ? ?/sec
bundle/bundle@threejs-minify                                        1.01     84.4±1.56ms        ? ?/sec    1.00     84.0±1.44ms        ? ?/sec
bundle/bundle@threejs-minify-sourcemap                              1.00    102.0±2.45ms        ? ?/sec    1.01    103.1±2.15ms        ? ?/sec
bundle/bundle@threejs-sourcemap                                     1.01     46.0±0.63ms        ? ?/sec    1.00     45.7±1.15ms        ? ?/sec
bundle/bundle@threejs10x                                            1.00    393.3±4.23ms        ? ?/sec    1.00    392.7±2.85ms        ? ?/sec
bundle/bundle@threejs10x-minify                                     1.00    989.0±9.32ms        ? ?/sec    1.00    988.1±8.06ms        ? ?/sec
bundle/bundle@threejs10x-minify-sourcemap                           1.00   1246.6±9.06ms        ? ?/sec    1.00  1241.7±14.77ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                                  1.00    460.8±4.14ms        ? ?/sec    1.01    464.8±4.16ms        ? ?/sec
remapping/remapping                                                 1.00     32.5±0.14ms        ? ?/sec    1.01     33.0±0.17ms        ? ?/sec
remapping/render-chunk-remapping                                    1.00     83.1±0.51ms        ? ?/sec    1.02     84.9±0.51ms        ? ?/sec
scan/scan@rome-ts                                                   1.03     84.3±1.15ms        ? ?/sec    1.00     81.9±0.76ms        ? ?/sec
scan/scan@threejs                                                   1.01     28.7±0.37ms        ? ?/sec    1.00     28.4±0.35ms        ? ?/sec
scan/scan@threejs10x                                                1.00    289.4±2.45ms        ? ?/sec    1.00    288.1±2.01ms        ? ?/sec

@hyf0 hyf0 added this pull request to the merge queue Aug 29, 2024
Merged via the queue into main with commit 33fca46 Aug 29, 2024
@hyf0 hyf0 deleted the 08-29-fix_plugin_replace_handle_backtrack_limit_exceeded_error branch August 29, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants