Type convert NULL to other pointer types for function call arguments.

Fixes issue #198.
This commit is contained in:
Matt Pharr
2012-03-27 09:50:21 -07:00
parent ca5c65d032
commit 6e9fea377d
2 changed files with 17 additions and 1 deletions

View File

@@ -3409,7 +3409,9 @@ FunctionCallExpr::TypeCheck() {
if (t == NULL)
return NULL;
argTypes.push_back(t);
argCouldBeNULL.push_back(lIsAllIntZeros(args->exprs[i]));
argCouldBeNULL.push_back(lIsAllIntZeros(args->exprs[i]) ||
dynamic_cast<NullPointerExpr *>(args->exprs[i]) != NULL);
}
FunctionSymbolExpr *fse = dynamic_cast<FunctionSymbolExpr *>(func);

View File

@@ -0,0 +1,14 @@
export uniform int width() { return programCount; }
bool bar(float * x) {
return (x != 0);
}
export void f_f(uniform float RET[], uniform float aFOO[]) {
RET[programIndex] = bar(NULL);
}
export void result(uniform float RET[]) {
RET[programIndex] = 0;
}