This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/5111] translator silently ignores "then" instead of "{"
- From: "joshua dot i dot stone at intel dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 5 Oct 2007 00:02:08 -0000
- Subject: [Bug translator/5111] translator silently ignores "then" instead of "{"
- References: <20071004231506.5111.dcnltc@us.ibm.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- 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.