| 1 |
fun vec3 hasReturn() |
| 2 |
{ |
| 3 |
return @(1,0,0); |
| 4 |
} |
| 5 |
|
| 6 |
//fun vec3 missingReturn() |
| 7 |
//{ |
| 8 |
// missing return |
| 9 |
//} |
| 10 |
|
| 11 |
// missing return statements default to 0 as appropriate |
| 12 |
// for return type; this tests that and that the stack |
| 13 |
// is okay afterwards, even for larger-than-int return types |
| 14 |
// like vec3 |
| 15 |
// <<< hasReturn(), missingReturn() >>>; |
| 16 |
|
| 17 |
// before the fix in 1.5.0.0, the above would incorrectly print |
| 18 |
// #(0.0000,0.0000,1.0000) #(0.0000,0.0000,0.0000) |
| 19 |
// this implies the stack pointer is off, due to missingReturn |
| 20 |
// not accounting for the size of its return type, vec3 |
| 21 |
|
| 22 |
// as of 1.5.0.9, non-void functions are required to return value |
| 23 |
<<< hasReturn() >>>; |