forked from nim-works/nimskull
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vmgen): incorrect code generation for
lent
/var
deref
Summary ======= Fix reading from a `var`/`lent` view of an unsigned integer (with bit- width <= 32) producing incorrect values, when using the VM. Details ======= * change `genDerefView` to take the `cnkDerefView` node as input, so that it has access to the type of the result * the type of the *view* (not the storage type) was previously passed to the `genRegLoad` call, resulting in no `NarrowU` instruction to be emitted for the memory access, and the value thus being sign-extended
- Loading branch information
Showing
2 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters