Skip to content

Missing error "some control paths may return to the caller" in this case #897

Closed
@jruderman

Description

@jruderman
fn f() -> ! { ret 42; fail; }
fn main() { }

Result:

Assertion failed: (getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"), function AssertOK, file Instructions.cpp, line 1065.

If I remove the "fail;" I get the error message I expect:

error: In non-returning function f, some control paths may return to the caller

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions