-
Notifications
You must be signed in to change notification settings - Fork 160
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
Add support for subtractions contenting references as right hand side operands #1898
Conversation
|
Benchmark Results for unmodified programs 🚀
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1898 +/- ##
=======================================
Coverage 96.33% 96.34%
=======================================
Files 102 102
Lines 40751 40830 +79
=======================================
+ Hits 39259 39336 +77
- Misses 1492 1494 +2 ☔ View full report in Codecov by Sentry. |
I think this is OK as it's a simple and fast fix, but we should create an issue to tackle the underlying problem later on: supporting arbitrary expressions like cairo-lang does. I think we would eventually need to define an AST for the expression. |
PR looks good but the description could be rephrased, I think it's not clear what's the issue. It can be simplified to something like:
Then it can describe why this happens.
Is |
The |
…o-vm into references-substraction
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>
typo Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>
Add support for subtractions contenting references as right hand side operands
Description
The
VM
readslet
expressions likec - tmp
as an addition instead of a subtraction, wherec
is a constant andtmp
is alocal
variable. This is because currently only additions are supported. This is not an issue with variables declared with thelet
keyword because those are resolved at compile time.This PR introduces a little refactor to allow subtractions with references as the rhs operand. It does it by saving the sign with which the reference is defined.
Checklist