Fix bug that prohibited assignments with pointer expressions on the LHS
Previously, code like "*(ptr+1) = foo" would claim that the LHS was invalid for an assignment expression. Issue #138.
This commit is contained in:
16
tests/ptr-assign-lhs-math-1.ispc
Normal file
16
tests/ptr-assign-lhs-math-1.ispc
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
uniform float a[programCount];
|
||||
a[programIndex] = aFOO[programIndex];
|
||||
|
||||
uniform float * uniform ptr = a;
|
||||
*(ptr+1) = 0;
|
||||
RET[programIndex] = a[programIndex];
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 1+programIndex;
|
||||
RET[1] = 0;
|
||||
}
|
||||
15
tests/ptr-assign-lhs-math-2.ispc
Normal file
15
tests/ptr-assign-lhs-math-2.ispc
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
uniform float a[programCount];
|
||||
a[programIndex] = aFOO[programIndex];
|
||||
|
||||
uniform float * varying ptr = a;
|
||||
*(ptr+programIndex) = 0;
|
||||
RET[programIndex] = a[programIndex];
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user