Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#273 type check for RSL printf args sometimes incorrect

fatal/crash
open
nobody
7
2012-09-20
2007-11-10
Chris Foster
No

It appears that the new typecheck code has problems with printf (and possibly with all varargs functions). Sometimes the arguments of such functions can have inconsistent types.

The following shader shows the problem:

surface type_bug()
{
printf("%f", noise(6*P));
}

The output compiled shader contains the following code section:

segment Code
pushv P
pushif 6
mulpp
noise3
pushis "%f"
pushif 1
printf

Clearly the mulpp instruction is errornous - it should in fact be mulfp. Running such a shader results in an assert or segfault.

Discussion

  • Michel Joron
    Michel Joron
    2008-02-20

    Logged In: YES
    user_id=208244
    Originator: NO

    a work-around will be to clarify the syntax on the printf like:

    surface type_bug()
    {
    float f = noise(6*P);
    printf("%f\n", f);
    }

     


Anonymous


Cancel   Add attachments