Conversation
PR SummaryMedium Risk Overview Fuel asm generation now lowers Testing is extended with an Written by Cursor Bugbot for commit 9988e37. This will update automatically on new commits. Configure here. |
|
Thanks for the contribution! It looks like @vaivaswatha is an internal user so signing the CLA is not required. However, they are not a member of this GitHub org so we can't confirm this. |
|
Thanks for the contribution! Unfortunately we can't verify the commit author(s): Vaivaswatha Nagaraj <v***@f***.sh> Vaivaswatha N <v***@f***.sh>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request. |
e43b077 to
9988e37
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| sorted_cases | ||
| .iter_mut() | ||
| .for_each(|(val, _)| *val -= min_case_value); | ||
| } |
There was a problem hiding this comment.
In-place SUBI corrupts discriminant register for successor blocks
High Severity
The SUBI writes the adjusted discriminant back into discrim_reg, the same virtual register returned by value_to_register(discriminant). This register is shared by all uses of that IR value. If any successor block references the discriminant directly (not via phi/block arguments), value_to_register returns the same register, and the successor sees the subtracted value instead of the original. A fresh temporary register from self.reg_seqr.next() is needed for the adjusted value.


Description
This PR adds a new IR instruction
switch, that supports both exhaustive (for exhaustivematchs, verified by the front-end) and non-exhaustive switches.Since
matchs in the frontend still translate to anif-elseladder, aswitchis never generated yet. So for testing, I've added support in the test harness to compile and execute (in the VM)sway-irfiles directly.