Skip to content
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

Error when using i64 values in functions #40

Closed
novoselrok opened this issue Dec 23, 2017 · 1 comment
Closed

Error when using i64 values in functions #40

novoselrok opened this issue Dec 23, 2017 · 1 comment
Assignees
Labels

Comments

@novoselrok
Copy link
Contributor

Overview

I get a compiler error when trying to use i64 type values in functions (assigning them to variables, or returning from functions).

When I try to compile this:

const x: i64 = 42;

everything works fine.

But, if this line is in a function:

function test(): void {
	const x: i64 = 42;
}

I get the following error:

CompileError: wasm validation error: at offset 27: type mismatch: expression has type i64 but expected i32
@ballercat ballercat self-assigned this Dec 24, 2017
@ballercat ballercat added the bug label Dec 24, 2017
@ballercat
Copy link
Owner

Thanks.

Looks like locals are not emitted correctly for i64 variables.

00000027:                1 ; function count
00000028:                c ; body size in bytes
00000029:                1 ; locals count
0000002a:                1 ; number of locals of following type
0000002b:               7f ; i32

Probably some older code I did not bother to fully test, should be easy enough to fix/test.

ballercat pushed a commit that referenced this issue Dec 24, 2017
ballercat added a commit that referenced this issue Dec 24, 2017
Implement #34
Fix #40
Fix(pretty sure) if/then regression mentioned in #38
Add coverage
Add gitter badge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants