h3rb / openshadinglanguage

Automatically exported from code.google.com/p/openshadinglanguage
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Middle of function return dowhile problem #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Trying to run the attached osl/oso with testshade crashes in LLVM build:

./oslc test_return_bug.osl
./testshade test_return_bug

It's due to eternal recursion, this is repeated a few thousand times when run 
through gdb:

#9  0x0000000100195a66 in OSL::pvt::llvm_gen_loop_op (rop=@0x7fff5fbfe8d0, 
opnum=0) at /Users/brecht/dev/osl/src/liboslexec/llvm_instance.cpp:2606
#10 0x000000010018c59b in OSL::pvt::RuntimeOptimizer::build_llvm_code 
(this=0x7fff5fbfe8d0, beginop=0, endop=6, bb=0x104018dc0) at 
/Users/brecht/dev/osl/src/liboslexec/llvm_instance.cpp:3674

I think the dowhile op to deal with middle of function return is wrong, perhaps 
the start label of the body should be 1 instead of 0 in the .oso file?

Tested on with svn revision 864 on Mac.

Original issue reported on code.google.com by brechtva...@gmail.com on 25 Nov 2010 at 4:15

Attachments: