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

fix wasm2c tests on 32-bit #2124

Merged
merged 1 commit into from
Jan 8, 2023
Merged

fix wasm2c tests on 32-bit #2124

merged 1 commit into from
Jan 8, 2023

Conversation

rathann
Copy link
Contributor

@rathann rathann commented Jan 8, 2023

The spectest_make_externref() in test/spec-wasm2c-prefix.c:203 assumes that u64 (uint64_t) can be converted to wasm_rt_externref_t (void *). This is not the case on 32-bit platforms.

- test/regress/regress-2039.txt
  expected error code 0, got 1.
  STDERR MISMATCH:
  --- expected
  +++ actual
  @@ -0,0 +1,19 @@
  +out/test/regress/regress-2039/regress-2039-main.c: In function ‘spectest_make_externref’:
  +out/test/regress/regress-2039/regress-2039-main.c:205:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  +  205 |   return (wasm_rt_externref_t)(x + 1);  // externref(0) is not null
  +      |          ^

The same error occurs with all wasm2c tests.

This fixes #2099.

The spectest_make_externref() in test/spec-wasm2c-prefix.c:203 assumes
that u64 (uint64_t) can be converted to wasm_rt_externref_t (void *).
This is not the case on 32-bit platforms.

```
- test/regress/regress-2039.txt
  expected error code 0, got 1.
  STDERR MISMATCH:
  --- expected
  +++ actual
  @@ -0,0 +1,19 @@
  +out/test/regress/regress-2039/regress-2039-main.c: In function ‘spectest_make_externref’:
  +out/test/regress/regress-2039/regress-2039-main.c:205:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  +  205 |   return (wasm_rt_externref_t)(x + 1);  // externref(0) is not null
  +      |          ^
```

The same error occurs with all wasm2c tests.

This fixes WebAssembly#2099.
Copy link
Member

@keithw keithw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for sending

@keithw
Copy link
Member

keithw commented Jan 8, 2023

Would be nice to have CI for i386 but I guess (#1971) we've still got a ways to go there.

@keithw keithw enabled auto-merge (squash) January 8, 2023 22:08
@keithw keithw merged commit 4fa2dfd into WebAssembly:main Jan 8, 2023
@rathann rathann deleted the issue-2099 branch January 9, 2023 10:21
@rathann
Copy link
Contributor Author

rathann commented Jan 9, 2023

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wasm2c tests fail on 32-bit due to assumption that pointers are 64-bit
2 participants