id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,lang,patch,platform
1630,null arguments automatically coerce to empty strings,pmichaud,,"While working on PCT and POST updates today, I ran into the following:

{{{
pmichaud@orange:~/parrot/trunk$ cat ../z.pir

.sub 'hello'
    null $P0
    'xyz'($P0)
.end

.sub 'xyz'
    .param string abc
    print ""'""
    print abc
    print ""'\n""
.end

pmichaud@orange:~/parrot/trunk$ ./parrot ../z.pir
''
pmichaud@orange:~/parrot/trunk$ 
}}}

The null PMC argument is automatically being coerced into an empty string, instead of throwing a ""Null PMC"" exception.  I spent a good hour chasing down a problem in PCT due to this little buglet.

The behavior apparently changed sometime between 1.4.0 and 2.0.0 (probably resulting from pcc changes):

{{{
pmichaud@orange:~/parrot/RELEASE_1_4_0$ cat ../z.pir

.sub 'hello'
    null $P0
    'xyz'($P0)
.end

.sub 'xyz'
    .param string abc
    print ""'""
    print abc
    print ""'\n""
.end

pmichaud@orange:~/parrot/RELEASE_1_4_0$ ./parrot ../z.pir
Null PMC access in get_string()
current instr.: 'xyz' pc 15 (../z.pir:7)
called from Sub 'hello' pc 10 (../z.pir:4)
pmichaud@orange:~/parrot/RELEASE_1_4_0$ 

----

pmichaud@orange:~/parrot/RELEASE_2_0_0$ cat ../z.pir

.sub 'hello'
    null $P0
    'xyz'($P0)
.end

.sub 'xyz'
    .param string abc
    print ""'""
    print abc
    print ""'\n""
.end

pmichaud@orange:~/parrot/RELEASE_2_0_0$ ./parrot ../z.pir
''
pmichaud@orange:~/parrot/RELEASE_2_0_0$ 
}}}


Pm",bug,closed,normal,,none,2.0.0,medium,fixed,,,,,
