This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/5111] translator silently ignores "then" instead of "{"


------- Additional Comments From joshua dot i dot stone at intel dot com  2007-10-05 00:02 -------
Several features of the language are conspiring to bite you here: implicit
variable declarations, optional braces around a single statement, and optional
statement terminators.  So this:

>         if (func() < 0) then
>                 print("why no syntax error\n")

is effectively parsed as this:

    if (func() < 0) {
        then;
    }
    print("why no syntax error\n")

The parser thinks that 'then' is a variable, and the optimizer determines that
'then;' has no effect, so it is thrown away.  If you pass '-u' to stap, it will
throw an unresolved type for 'then'.

We may need a translator warning when it encounters such statements, with no
assigments and no function calls.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5111

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]