| Index: src/IceTargetLoweringX8632.cpp
|
| diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
|
| index 0423e3929c389649fb563dc97f828d5f4ed1468b..930836b0dad99613584fee79c795ced34c745d1a 100644
|
| --- a/src/IceTargetLoweringX8632.cpp
|
| +++ b/src/IceTargetLoweringX8632.cpp
|
| @@ -18,6 +18,7 @@
|
| #include "IceDefs.h"
|
| #include "IceCfg.h"
|
| #include "IceCfgNode.h"
|
| +#include "IceClFlags.h"
|
| #include "IceInstX8632.h"
|
| #include "IceOperand.h"
|
| #include "IceTargetLoweringX8632.def"
|
| @@ -3052,13 +3053,19 @@ void TargetX8632::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
|
| return;
|
| }
|
| case Intrinsics::NaClReadTP: {
|
| - Constant *Zero = Ctx->getConstantZero(IceType_i32);
|
| - Operand *Src = OperandX8632Mem::create(Func, IceType_i32, NULL, Zero, NULL,
|
| - 0, OperandX8632Mem::SegReg_GS);
|
| - Variable *Dest = Instr->getDest();
|
| - Variable *T = NULL;
|
| - _mov(T, Src);
|
| - _mov(Dest, T);
|
| + if (Ctx->getFlags().UseSandboxing) {
|
| + Constant *Zero = Ctx->getConstantZero(IceType_i32);
|
| + Operand *Src =
|
| + OperandX8632Mem::create(Func, IceType_i32, NULL, Zero, NULL,
|
| + 0, OperandX8632Mem::SegReg_GS);
|
| + Variable *Dest = Instr->getDest();
|
| + Variable *T = NULL;
|
| + _mov(T, Src);
|
| + _mov(Dest, T);
|
| + } else {
|
| + InstCall *Call = makeHelperCall("__nacl_read_tp", Instr->getDest(), 0);
|
| + lowerCall(Call);
|
| + }
|
| return;
|
| }
|
| case Intrinsics::Setjmp: {
|
|
|