Fix bugs where typecasting an expression to void would cause it to disappear.
This was obviously problematic in cases where the expression was a function call or the like, with side effects. Fixes issue #199.
This commit is contained in:
17
tests/typecast-void-funcall.ispc
Normal file
17
tests/typecast-void-funcall.ispc
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
uniform float add(float a, float b, uniform float * uniform result) {
|
||||
result[programIndex] = a+b;
|
||||
return 1;
|
||||
}
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
float a = aFOO[programIndex];
|
||||
float b = 0.; b = a;
|
||||
(void)add(a, b, RET);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 2 + 2*programIndex;
|
||||
}
|
||||
Reference in New Issue
Block a user