Skip to content

Unsized function argument causes LLVM segfault #41229

Closed

Description

@arielb1

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.

Activity

  1. added
    A-codegenArea: Code generation
    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
    on Apr 13, 2017
  2. nateozem commented on Apr 18, 2017

    @nateozem

    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?

  3. Mark-Simulacrum commented on Jun 21, 2017

    @Mark-Simulacrum
    Member

    I cannot reproduce today. Marking as E-needstest.

  4. added
    C-bugCategory: This is a bug.
    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
    on Jul 27, 2017
  5. added a commit that references this issue on Sep 9, 2017
  6. added a commit that references this issue on Sep 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationC-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions