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

Unsized function argument causes LLVM segfault #41229

Closed
arielb1 opened this issue Apr 11, 2017 · 2 comments
Closed

Unsized function argument causes LLVM segfault #41229

arielb1 opened this issue Apr 11, 2017 · 2 comments
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@arielb1
Copy link
Contributor

arielb1 commented Apr 11, 2017

Meta

rustc 1.18.0-nightly (3b5754e5c 2017-04-10)

STR

pub fn example(ref s: str) {}

fn main() {}

Result

rustc 1.18.0-nightly (3b5754e5c 2017-04-10)
warning: unused variable: `s`
 --> <anon>:1:16
  |
1 | pub fn example(ref s: str) {}
  |                ^^^^^
  |
  = note: #[warn(unused_variables)] on by default

Segmentation fault (core dumped)

This is not an LLVM assertion, but rather a NULL pointer passed to val_ty.

@alexcrichton alexcrichton added A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. labels Apr 13, 2017
@nateozem
Copy link

I tried to replicate issue, but failed to do so.

 $ rustc -vV
rustc 1.18.0-nightly (ad36c2f55 2017-04-09)
binary: rustc
commit-hash: ad36c2f5528d617db66c244d8bcbfc4b36da0ca0
commit-date: 2017-04-09
host: x86_64-apple-darwin
release: 1.18.0-nightly
LLVM version: 3.9

 $ rustc src/main.rs
warning: unused variable: `s`
 --> src/main.rs:1:16
  |
1 | pub fn example(ref s: str) {}
  |                ^^^^^
  |
  = note: #[warn(unused_variables)] on by default

 $ ./main

 $ 

What process and commands did you run?

@Mark-Simulacrum
Copy link
Member

I cannot reproduce today. Marking as E-needstest.

@Mark-Simulacrum Mark-Simulacrum added C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. labels Jul 27, 2017
Dushistov added a commit to Dushistov/rust that referenced this issue Sep 9, 2017
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Sep 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

No branches or pull requests

4 participants