Richard Viney
Richard Viney

Reputation: 1007

Why does Xcode 4.3 static analysis report a logic error with this code?

I'm uncertain about why Xcode 4.3 reports "Logic error. Undefined or garbage value returned to caller" when running static analysis on the following C++ code. The error is reported to be at the line return e;.

enum MyEnum { MyEnumValue };

MyEnum myFunction() {
    try {
        throw MyEnumValue;
    } catch (MyEnum e) {
        return e;
    }

    return MyEnumValue;
}

Any clues??

Upvotes: 1

Views: 342

Answers (1)

Richard Viney
Richard Viney

Reputation: 1007

This was a bug in Xcode 4.3 that seems to be fixed now in Xcode 4.4.

Upvotes: 1

Related Questions