Fix normal (non-swap) dup path - #383
Conversation
|
light mode discord jumpscare |
| @@ -1846,13 +1849,15 @@ static int32_t bytesToSlotCount(VMContext* ctx, int32_t nativeBytes, int32_t sta | |||
| require(remaining == 0); // Byte count must align exactly to slot boundaries | |||
There was a problem hiding this comment.
The Chapter 4 Test Hits this now
|
type1 is the unit of measurement, not the type of each element.
16 + 4 = the 20 bytes requested, and exactly what both consumers eat. No int32 in the window, nothing mistagged. |
|
type1 is the type of the element on the top of the stack, the YoYo Runner does not use tagged elements, so it relies on the type1 to figure out how many bytes will be removed from the stack The issue is that the compiler sometimes emits a INT32 type even though the top of the stack is VARIABLE Butterscotch tags the original stack type for each element, but in reality it wouldn't need that, because dup only duplicates the same type always, you can just peek the top of the stack for what is the type that is being used and then figure out the byte size for that For the integer type, it would require to peek the top to see if it is a variable and, if the type1 is a integer, divide the dup size by 4 |
While developing Starfait I've noticed that the Butterscotch's
handleDuppath is completely borkedThis is a WIP because the swap path also needs to be updated, I haven't done the research on how the swap path should ACTUALLY work
Explanation: