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

Malloc Panics with -O0 or crane_lift #174

Closed
eldesh opened this issue Dec 20, 2023 · 1 comment
Closed

Malloc Panics with -O0 or crane_lift #174

eldesh opened this issue Dec 20, 2023 · 1 comment

Comments

@eldesh
Copy link

eldesh commented Dec 20, 2023

In e38231f, compiling the following code at -O0:

size: Usz = 1
main () =
  _ = malloc size

main ()

Results in the compiler panicking and outputting the following error:

$ ante  -b bug.an
thread 'main' panicked at src/cranelift_backend/context.rs:197:13:
- inst0 (v1 = call fn0(v0)): arg 0 (v0) has type i8, expected i64

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

No errors occur with -O3.

@jfecher
Copy link
Owner

jfecher commented Dec 20, 2023

This is a duplicate of #142. The code works as expected when using malloc 1 directly.

@jfecher jfecher closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2023
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

No branches or pull requests

2 participants