Fix up return statements in unmasked regions
This commit is contained in:
6
stmt.cpp
6
stmt.cpp
@@ -2972,6 +2972,12 @@ UnmaskedStmt::EmitCode(FunctionEmitContext *ctx) const {
|
|||||||
|
|
||||||
stmts->EmitCode(ctx);
|
stmts->EmitCode(ctx);
|
||||||
|
|
||||||
|
|
||||||
|
// Do not restore old mask if our basic block is over. This happends if we emit code
|
||||||
|
// for something like 'unmasked{return;}', for example.
|
||||||
|
if (ctx->GetCurrentBasicBlock() == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
ctx->SetInternalMask(oldInternalMask);
|
ctx->SetInternalMask(oldInternalMask);
|
||||||
ctx->SetFunctionMask(oldFunctionMask);
|
ctx->SetFunctionMask(oldFunctionMask);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user