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

[Merged by Bors] - Fixed #1768 #1820

Closed
wants to merge 3 commits into from
Closed

[Merged by Bors] - Fixed #1768 #1820

wants to merge 3 commits into from

Conversation

Razican
Copy link
Member

@Razican Razican commented Feb 5, 2022

This Pull Request fixes/closes #1768.

It adds one extra peeked token in the buffered lexer, since it didn't take into account that the stream might end just after the last peeked token. The panic was only happening in debug mode, but still, this was wrong.

@Razican Razican added bug Something isn't working lexer Issues surrounding the lexer labels Feb 5, 2022
@Razican Razican added this to the v0.14.0 milestone Feb 5, 2022
@Razican Razican linked an issue Feb 5, 2022 that may be closed by this pull request
@Razican
Copy link
Member Author

Razican commented Feb 7, 2022

bors r+

@bors
Copy link

bors bot commented Feb 7, 2022

🕐 Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@github-actions
Copy link

github-actions bot commented Feb 7, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 87,912 87,912 0
Passed 40,892 40,892 0
Ignored 19,929 19,929 0
Failed 27,091 27,091 0
Panics 0 0 0
Conformance 46.51% 46.51% 0.00%

@codecov
Copy link

codecov bot commented Feb 7, 2022

Codecov Report

Merging #1820 (7aa59ea) into main (55e85ad) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1820   +/-   ##
=======================================
  Coverage   55.73%   55.73%           
=======================================
  Files         201      201           
  Lines       17326    17326           
=======================================
  Hits         9656     9656           
  Misses       7670     7670           
Impacted Files Coverage Δ
boa/src/syntax/parser/cursor/buffered_lexer/mod.rs 79.72% <ø> (ø)
boa/src/syntax/parser/expression/assignment/mod.rs 39.17% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55e85ad...7aa59ea. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Feb 7, 2022

Benchmark for 7f2bf40

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 393.4±0.55ns 395.9±0.75ns +0.64%
Arithmetic operations (Execution) 1919.9±2.75ns 1951.3±2.18ns +1.64%
Arithmetic operations (Parser) 5.8±0.01µs 5.7±0.01µs -1.72%
Array access (Compiler) 835.2±1.75ns 835.9±1.92ns +0.08%
Array access (Execution) 10.5±0.26µs 10.5±0.03µs 0.00%
Array access (Parser) 12.5±0.13µs 12.2±0.02µs -2.40%
Array creation (Compiler) 1194.9±5.40ns 1180.1±2.93ns -1.24%
Array creation (Execution) 3.1±0.01ms 3.2±0.00ms +3.23%
Array creation (Parser) 13.8±0.02µs 13.5±0.02µs -2.17%
Array pop (Compiler) 2.8±0.01µs 2.9±0.00µs +3.57%
Array pop (Execution) 1327.9±5.18µs 1348.1±11.14µs +1.52%
Array pop (Parser) 143.1±0.16µs 144.1±0.16µs +0.70%
Boolean Object Access (Compiler) 687.6±1.15ns 705.7±0.92ns +2.63%
Boolean Object Access (Execution) 6.7±0.03µs 6.9±0.03µs +2.99%
Boolean Object Access (Parser) 14.4±0.01µs 14.4±0.01µs 0.00%
Clean js (Compiler) 2.2±0.01µs 2.2±0.01µs 0.00%
Clean js (Execution) 1447.2±9.53µs 1468.2±12.61µs +1.45%
Clean js (Parser) 29.8±0.07µs 29.6±0.04µs -0.67%
Create Realm 331.1±3.48ns 335.3±1.31ns +1.27%
Dynamic Object Property Access (Compiler) 1168.7±4.35ns 1163.0±3.16ns -0.49%
Dynamic Object Property Access (Execution) 6.9±0.07µs 6.9±0.04µs 0.00%
Dynamic Object Property Access (Parser) 11.0±0.02µs 10.9±0.02µs -0.91%
Fibonacci (Compiler) 1520.1±4.69ns 1472.3±3.51ns -3.14%
Fibonacci (Execution) 2.8±0.00ms 2.8±0.01ms 0.00%
Fibonacci (Parser) 16.7±0.02µs 16.4±0.02µs -1.80%
For loop (Compiler) 1282.9±7.98ns 1277.3±7.06ns -0.44%
For loop (Execution) 42.9±0.14µs 43.8±0.17µs +2.10%
For loop (Parser) 14.3±0.02µs 14.2±0.02µs -0.70%
Mini js (Compiler) 2.2±0.00µs 2.2±0.00µs 0.00%
Mini js (Execution) 1336.6±10.37µs 1360.0±6.85µs +1.75%
Mini js (Parser) 26.4±0.02µs 25.9±0.04µs -1.89%
Number Object Access (Compiler) 643.1±1.37ns 659.9±1.47ns +2.61%
Number Object Access (Execution) 5.3±0.01µs 5.4±0.02µs +1.89%
Number Object Access (Parser) 11.4±0.01µs 11.3±0.01µs -0.88%
Object Creation (Compiler) 957.3±2.11ns 958.0±1.82ns +0.07%
Object Creation (Execution) 6.2±0.02µs 6.2±0.02µs 0.00%
Object Creation (Parser) 9.5±0.02µs 9.3±0.02µs -2.11%
RegExp (Compiler) 1134.0±1.76ns 1146.2±2.25ns +1.08%
RegExp (Execution) 13.0±0.03µs 12.8±0.03µs -1.54%
RegExp (Parser) 10.5±0.01µs 10.3±0.02µs -1.90%
RegExp Creation (Compiler) 1018.4±3.82ns 1048.6±3.10ns +2.97%
RegExp Creation (Execution) 9.9±0.05µs 9.5±0.04µs -4.04%
RegExp Creation (Parser) 8.7±0.01µs 8.6±0.02µs -1.15%
RegExp Literal (Compiler) 1147.2±2.78ns 1137.3±0.95ns -0.86%
RegExp Literal (Execution) 13.1±0.05µs 12.8±0.05µs -2.29%
RegExp Literal (Parser) 8.4±0.01µs 8.2±0.01µs -2.38%
RegExp Literal Creation (Compiler) 1024.3±3.41ns 1053.7±6.17ns +2.87%
RegExp Literal Creation (Execution) 9.9±0.05µs 9.6±0.05µs -3.03%
RegExp Literal Creation (Parser) 6.6±0.01µs 6.5±0.01µs -1.52%
Static Object Property Access (Compiler) 973.1±2.50ns 982.2±2.76ns +0.94%
Static Object Property Access (Execution) 6.4±0.04µs 6.5±0.02µs +1.56%
Static Object Property Access (Parser) 10.2±0.01µs 10.0±0.02µs -1.96%
String Object Access (Compiler) 1026.8±6.03ns 1035.8±3.98ns +0.88%
String Object Access (Execution) 8.6±0.02µs 8.7±0.02µs +1.16%
String Object Access (Parser) 14.3±0.06µs 14.1±0.02µs -1.40%
String comparison (Compiler) 1301.0±4.82ns 1287.6±3.29ns -1.03%
String comparison (Execution) 7.2±0.03µs 7.2±0.03µs 0.00%
String comparison (Parser) 11.3±0.02µs 11.2±0.03µs -0.88%
String concatenation (Compiler) 1050.4±3.16ns 1065.6±2.63ns +1.45%
String concatenation (Execution) 6.2±0.02µs 6.2±0.02µs 0.00%
String concatenation (Parser) 7.8±0.01µs 7.7±0.02µs -1.28%
String copy (Compiler) 883.6±2.41ns 881.1±2.89ns -0.28%
String copy (Execution) 5.3±0.01µs 5.4±0.02µs +1.89%
String copy (Parser) 5.8±0.01µs 5.7±0.01µs -1.72%
Symbols (Compiler) 639.1±1.79ns 650.3±4.82ns +1.75%
Symbols (Execution) 4.9±0.01µs 5.0±0.01µs +2.04%
Symbols (Parser) 4.4±0.02µs 4.4±0.01µs 0.00%

@Razican
Copy link
Member Author

Razican commented Feb 7, 2022

bors r+

bors bot pushed a commit that referenced this pull request Feb 7, 2022
This Pull Request fixes/closes #1768.

It adds one extra peeked token in the buffered lexer, since it didn't take into account that the stream might end just after the last peeked token. The panic was only happening in debug mode, but still, this was wrong.
@bors
Copy link

bors bot commented Feb 7, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Fixed #1768 [Merged by Bors] - Fixed #1768 Feb 7, 2022
@bors bors bot closed this Feb 7, 2022
@bors bors bot deleted the fix_1399 branch February 7, 2022 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lexer Issues surrounding the lexer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when parsing fuzzed code
3 participants