Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jun 16, 2025

Fix #11723.

Fix 2 cases where parser was using static strings for AST nodes.

This is fine on Rust side, but it breaks raw transfer, because raw transfer requires all data (including strings) to be in the arena. All it knows is what's in the arena, and a &'static str is stored outside that, so it can't read the string data.

Unfortunately, we have no way to statically prevent putting an Atom created from a &'static str in AST, because type system allows a 'static lifetime to be "squeezed" down to 'a. So we have to play "whack-a-mole" with any such bugs at present (unfortunately conformance tests don't cover the cases in #11723).

@github-actions github-actions bot added A-parser Area - Parser C-bug Category - Bug labels Jun 16, 2025
Copy link
Member Author

overlookmotel commented Jun 16, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

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

@codspeed-hq
Copy link

codspeed-hq bot commented Jun 16, 2025

CodSpeed Instrumentation Performance Report

Merging #11738 will improve performances by 12.72%

Comparing 06-16-fix_parser_allocate_all_strings_in_arena (854b0f1) with 06-16-feat_parser_introduce_parserimpl_token_source_method (e05d9bb)

Summary

⚡ 1 improvements
✅ 37 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
mangler[cal.com.tsx] 3.1 ms 2.7 ms +12.72%

@overlookmotel overlookmotel marked this pull request as ready for review June 16, 2025 10:32
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jun 16, 2025
Copy link
Member

Boshen commented Jun 16, 2025

Merge activity

Fix #11723.

Fix 2 cases where parser was using static strings for AST nodes.

This is fine on Rust side, but it breaks raw transfer, because raw transfer requires all data (including strings) to be in the arena. All it knows is what's in the arena, and a `&'static str` is stored outside that, so it can't read the string data.

Unfortunately, we have no way to statically prevent putting an `Atom` created from a `&'static str` in AST, because type system allows a `'static` lifetime to be "squeezed" down to `'a`. So we have to play "whack-a-mole" with any such bugs at present (unfortunately conformance tests don't cover the cases in #11723).
@graphite-app graphite-app bot force-pushed the 06-16-feat_parser_introduce_parserimpl_token_source_method branch from 4bc8335 to e05d9bb Compare June 16, 2025 11:14
@graphite-app graphite-app bot force-pushed the 06-16-fix_parser_allocate_all_strings_in_arena branch from 47d7ed8 to 854b0f1 Compare June 16, 2025 11:14
Base automatically changed from 06-16-feat_parser_introduce_parserimpl_token_source_method to main June 16, 2025 11:20
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jun 16, 2025
@graphite-app graphite-app bot merged commit 854b0f1 into main Jun 16, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 06-16-fix_parser_allocate_all_strings_in_arena branch June 16, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oxc-parser: AST issue for type Foo = intrinsic.bar with rawTransfer enabled

3 participants