-
Notifications
You must be signed in to change notification settings - Fork 122
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
64 bit LEB128 constant encoding #78
Conversation
} | ||
export function test(): i32 { | ||
return number(): i32; | ||
} | ||
`).then(result => t.is(result.instance.exports.test(), 0)); | ||
`).then(result => t.is(result.instance.exports.test(), 42)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my information, the test
function is doing a conversion from i64
to i32
? Is this your technique to test 64 bits ints in js?
I like how TypeScript explicitly does it: number() as i32
(just an idea).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but 64-bit nums are tested indirectly. If that encoding failed, then the data would be garbage or the program wouldn't compile at runtime.
The :
is a type cast operator borrowed from flow
The constant encoding for 64-bit integers/floats is non-existent and is done via runtime typecasts instead. This is work to fix that.
Fixing some things while here.