Skip to content

translating statics/consts segfaults LLVM if order is wrong #29884

Description

@nikomatsakis

This test case (a permutation of const-autoderef.rs) causes rustc to segfault (somewhere in LLVM):

static B: u8 = (&A)[0];
static A: [u8; 1] = ['h' as u8];
static D: u8 = (&C)[0];
static C: &'static &'static &'static &'static [u8; 1] = & & & &A;

pub fn main() {
    assert_eq!(B, A[0]);
    assert_eq!(D, A[0]);
}

Uncovered while working on separating items from HIR, since the new visitors can sometimes visit items in different orders (unless you force them to do otherwise).

Activity

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-codegenArea: Code generationI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions