Skip to content

Handling goto to start of function #579

@l-kent

Description

@l-kent

The example in #316 has a failing assertion when put through BASIL:

[ERROR]   errorFn_1840 Entry block malformed, missing or has incoming jumps: Some(ListSet(GoTo(errorFn_entry))) [[email protected]:16]
Exception in thread "main" java.lang.AssertionError
    at ir.transforms.ReplaceReturn$package$.establishProcedureDiamondForm(ReplaceReturn.scala:143) 

This is caused by the following function in the C source:

void errorFn() {
ERROR:
  goto ERROR;
}

This is compiled to a function where the first block contains a jump to itself, though any function that has a label for a manual goto at its start should produce a similar result and cause this same assertion failure.

How do we want to handle this niche case? Does it cause problems elsewhere if we allow the first block of a procedure to be a loop header? @agle

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