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/21173] odd translator behavior with overloaded functions


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.

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