16
stmt.cpp
16
stmt.cpp
@@ -3137,11 +3137,12 @@ AssertStmt::EmitCode(FunctionEmitContext *ctx) const {
|
|||||||
if (!ctx->GetCurrentBasicBlock())
|
if (!ctx->GetCurrentBasicBlock())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (expr == NULL)
|
const Type *type;
|
||||||
return;
|
if (expr == NULL ||
|
||||||
const Type *type = expr->GetType();
|
(type = expr->GetType()) == NULL) {
|
||||||
if (type == NULL)
|
AssertPos(pos, m->errorCount > 0);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
bool isUniform = type->IsUniformType();
|
bool isUniform = type->IsUniformType();
|
||||||
|
|
||||||
// The actual functionality to do the check and then handle falure is
|
// The actual functionality to do the check and then handle falure is
|
||||||
@@ -3162,7 +3163,12 @@ AssertStmt::EmitCode(FunctionEmitContext *ctx) const {
|
|||||||
|
|
||||||
std::vector<llvm::Value *> args;
|
std::vector<llvm::Value *> args;
|
||||||
args.push_back(ctx->GetStringPtr(errorString));
|
args.push_back(ctx->GetStringPtr(errorString));
|
||||||
args.push_back(expr->GetValue(ctx));
|
llvm::Value *exprValue = expr->GetValue(ctx);
|
||||||
|
if (exprValue == NULL) {
|
||||||
|
AssertPos(pos, m->errorCount > 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
args.push_back(exprValue);
|
||||||
args.push_back(ctx->GetFullMask());
|
args.push_back(ctx->GetFullMask());
|
||||||
ctx->CallInst(assertFunc, NULL, args, "");
|
ctx->CallInst(assertFunc, NULL, args, "");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user