public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "dsmith at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug translator/21173] odd translator behavior with overloaded functions
Date: Mon, 20 Feb 2017 18:41:00 -0000	[thread overview]
Message-ID: <bug-21173-6586-ZTBM67JN9d@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-21173-6586@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=21173

--- Comment #2 from David Smith <dsmith at redhat dot com> ---
If I comment out the call to __inode_vfsmount(), I get the expected error about
a type mismatch:

====
# cat ../src/test.stp
function foo:long(a:long, b:long)
{
        return (a + b)
}

function foo:string(a:long, b:string, c:long)
{
        return sprintf("%s %d", b, a + c)
}

probe begin
{
#       println(__inode_vfsmount(1))
        println(foo(1, 2, 3))
}
# stap -p2 ../src/test.stp
WARNING: Eliding unused function 'foo': identifier 'foo' at
../src/test.stp:1:10
 source: function foo:long(a:long, b:long)
                  ^
semantic error: type mismatch: expected long but found string: number '2' at
:14:17
        source:         println(foo(1, 2, 3))
                                       ^

Pass 2: analysis failed.  [man error::pass2]
====

If I comment out the call to foo(), the script gets passes the semantic pass
with no problems (other than warning about unused function 'foo').

====
# cat ../src/test.stp
function foo:long(a:long, b:long)
{
        return (a + b)
}

function foo:string(a:long, b:string, c:long)
{
        return sprintf("%s %d", b, a + c)
}

probe begin
{
        println(__inode_vfsmount(1))
#       println(foo(1, 2, 3))
}
# stap -p2 ../src/test.stp > /dev/null
WARNING: Eliding unused function 'foo': identifier 'foo' at
../src/test.stp:1:10
 source: function foo:long(a:long, b:long)
                  ^
Number of similar warning messages suppressed: 1.
Rerun with -v to see them.
====

Somehow it is the combination of the two that causes the odd behavior.

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

  parent reply	other threads:[~2017-02-20 18:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16 19:01 [Bug translator/21173] New: " dsmith at redhat dot com
2017-02-20 18:37 ` [Bug translator/21173] " dsmith at redhat dot com
2017-02-20 18:41 ` dsmith at redhat dot com [this message]
2017-02-20 21:16 ` dsmith at redhat dot com
2017-02-20 22:47 ` dsmith at redhat dot com
2020-11-14 18:43 ` fche at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-21173-6586-ZTBM67JN9d@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).