DenialAdams / roland

Roland programming language
https://www.brick.codes/roland
Apache License 2.0
48 stars 0 forks source link

truncating from usize -> u8 (for example) doesn't actually truncate at runtime #41

Closed DenialAdams closed 1 year ago

DenialAdams commented 2 years ago

Can be observed in this sample program:

https://github.com/exoticorn/microw8/blob/master/examples/rust/tunnel.rs

Since wasm doesn't give us this "for free", we'll have to add a runtime implementation ourself and call when appropriate.

As a workaround, forcing a store (by going to an intermediate local) should resolve the issue

DenialAdams commented 2 years ago

overflow has the same issue. bleh. we could just insert a store followed by a load to force the wrapping?

DenialAdams commented 2 years ago

Created #45 for overflow

DenialAdams commented 1 year ago

Closed in d8300c8