god / man

202 stars 25 forks source link

man fails even if is_innocent #12

Open Cortexelus opened 9 years ago

Cortexelus commented 9 years ago

apple_products.txt

function eat()
{
    if (is_innocent)
        insertKnowledges([Good, Evil]);
    else
        goto fail;
        goto fail;

    removeKnowledges([Good, Evil]); // Avoid side effects
    return true;

    fail:
        logoutFromGarden();
}

Although the second "goto fail" is indented, the use of brackets in the function definition assumes a C-based pseudocode syntax, thus this line is actually outside the else clause and gets executed every time. Step-wise debugger verifies this.

This may explain the fall of man despite his innocence.

Classic syntax error.