Skip to content

Comments

fix(codegen): fix arithmetic overflow printing unspanned NewExpression#7289

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-15-fix_codegen_fix_arithmetic_overflow_printing_unspanned_newexpression_
Nov 15, 2024
Merged

fix(codegen): fix arithmetic overflow printing unspanned NewExpression#7289
graphite-app[bot] merged 1 commit intomainfrom
11-15-fix_codegen_fix_arithmetic_overflow_printing_unspanned_newexpression_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 15, 2024

self.span.end - 1 overflows if the NewExpression is generated in transformer and has no span, so self.span.end == 0.

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 15, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

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

@github-actions github-actions bot added A-codegen Area - Code Generation C-bug Category - Bug labels Nov 15, 2024
Copy link
Member Author

@overlookmotel overlookmotel marked this pull request as ready for review November 15, 2024 00:39
@overlookmotel overlookmotel requested a review from Boshen November 15, 2024 00:39
@overlookmotel
Copy link
Member Author

@Boshen I'm not sure if this is the best way to solve the problem?

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 15, 2024

CodSpeed Performance Report

Merging #7289 will not alter performance

Comparing 11-15-fix_codegen_fix_arithmetic_overflow_printing_unspanned_newexpression_ (33ec4e6) with main (f0affa2)

Summary

✅ 30 untouched benchmarks

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Nov 15, 2024
Copy link
Member

Boshen commented Nov 15, 2024

Merge activity

  • Nov 14, 9:56 PM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Nov 14, 9:56 PM EST: A user added this pull request to the Graphite merge queue.
  • Nov 14, 10:01 PM EST: A user merged this pull request with the Graphite merge queue.

…on` (#7289)

`self.span.end - 1` overflows if the `NewExpression` is generated in transformer and has no span, so `self.span.end == 0`.
@Boshen Boshen force-pushed the 11-15-fix_codegen_fix_arithmetic_overflow_printing_unspanned_newexpression_ branch from 6de410a to 33ec4e6 Compare November 15, 2024 02:56
@graphite-app graphite-app bot merged commit 33ec4e6 into main Nov 15, 2024
@graphite-app graphite-app bot deleted the 11-15-fix_codegen_fix_arithmetic_overflow_printing_unspanned_newexpression_ branch November 15, 2024 03:01
Boshen pushed a commit that referenced this pull request Nov 15, 2024
Similar to #7289. Check if `span.end` is 0 before doing `span.end - 1`, to prevent arithmetic overflow.

Also changed all checks to `span.end > 0`, just for consistency.
Boshen pushed a commit that referenced this pull request Nov 15, 2024
Similar to #7289. Check if `span.end` is 0 before doing `span.end - 1`, to prevent arithmetic overflow.

Also changed all checks to `span.end > 0`, just for consistency.
Dunqing pushed a commit that referenced this pull request Nov 17, 2024
…on` (#7289)

`self.span.end - 1` overflows if the `NewExpression` is generated in transformer and has no span, so `self.span.end == 0`.
Dunqing pushed a commit that referenced this pull request Nov 17, 2024
Similar to #7289. Check if `span.end` is 0 before doing `span.end - 1`, to prevent arithmetic overflow.

Also changed all checks to `span.end > 0`, just for consistency.
Dunqing pushed a commit that referenced this pull request Nov 18, 2024
…on` (#7289)

`self.span.end - 1` overflows if the `NewExpression` is generated in transformer and has no span, so `self.span.end == 0`.
Dunqing pushed a commit that referenced this pull request Nov 18, 2024
Similar to #7289. Check if `span.end` is 0 before doing `span.end - 1`, to prevent arithmetic overflow.

Also changed all checks to `span.end > 0`, just for consistency.
Dunqing pushed a commit that referenced this pull request Nov 18, 2024
…on` (#7289)

`self.span.end - 1` overflows if the `NewExpression` is generated in transformer and has no span, so `self.span.end == 0`.
Dunqing pushed a commit that referenced this pull request Nov 18, 2024
Similar to #7289. Check if `span.end` is 0 before doing `span.end - 1`, to prevent arithmetic overflow.

Also changed all checks to `span.end > 0`, just for consistency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-codegen Area - Code Generation C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants