Pointer fixes/improvements.
Allow <, <=, >, >= comparisons of pointers
Allow explicit type-casting of pointers to and from integers
Fix bug in handling expressions of the form "int + ptr" ("ptr + int"
was fine).
Fix a bug in TypeCastExpr where varying -> uniform typecasts
would be allowed (leading to a crash later)
This commit is contained in:
4
tests_errors/func-export-task.ispc
Normal file
4
tests_errors/func-export-task.ispc
Normal file
@@ -0,0 +1,4 @@
|
||||
// Function can't have both "task" and "export" qualifiers
|
||||
|
||||
export task void foo() {
|
||||
}
|
||||
6
tests_errors/ptrcast-lose-info.ispc
Normal file
6
tests_errors/ptrcast-lose-info.ispc
Normal file
@@ -0,0 +1,6 @@
|
||||
// Pointer type cast of type "int32 * uniform" to integer type "uniform int32" may lose information.
|
||||
|
||||
int32 foo(int * uniform x) {
|
||||
return (int32) x;
|
||||
}
|
||||
|
||||
6
tests_errors/vary-to-unif-typecast.ispc
Normal file
6
tests_errors/vary-to-unif-typecast.ispc
Normal file
@@ -0,0 +1,6 @@
|
||||
// Can't type cast from varying type "int32" to uniform type "uniform int32"
|
||||
|
||||
uniform int foo(int x) {
|
||||
return (uniform int) x;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user