-
-
Notifications
You must be signed in to change notification settings - Fork 672
changetype number to bool #342
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
Comments
Note that For casting, there is |
I think change this to |
Does C/C++ handle |
Currently
|
Ok, so we should add a special case for bool I guess. |
For reference: #include <stdbool.h>
#define WASM_EXPORT __attribute__((visibility("default")))
WASM_EXPORT
bool test(int i) {
return ((bool)i) == true;
} compiles to (func $test (export "test") (type $t1) (param $p0 i32) (result i32)
get_local $p0
i32.const 0
i32.ne
) so |
Fixed in #343 for casts. Please keep in mind that |
cool |
The assemblyscript code
I expected:
assert(false == changetype(2)); // failed
In fact, all asserts passed.
It seemed that
changetype
number to bool just get the last bit.The text was updated successfully, but these errors were encountered: