Skip to content

Commit

Permalink
Fix ptrtoint
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-fink committed Dec 28, 2023
1 parent cff0e94 commit a28e444
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/lib/CodeGen/CGBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19870,8 +19870,8 @@ Value *CodeGenFunction::EmitWebAssemblyBuiltinExpr(unsigned BuiltinID,
llvm::Type *IntTy = llvm::Type::getInt64Ty(Builder.getContext());
Value *Ptr = EmitScalarExpr(E->getArg(0));
Value *Tag = EmitScalarExpr(E->getArg(1));
Value *IntPtr = Builder.CreateIntToPtr(Ptr, IntTy);
Value *IntTag = Builder.CreateIntToPtr(Tag, IntTy);
Value *IntPtr = Builder.CreatePtrToInt(Ptr, IntTy);
Value *IntTag = Builder.CreatePtrToInt(Tag, IntTy);
Value *BitMask = llvm::ConstantInt::get(IntTy, 0x0000'FFFF'FFFF'FFFF, false);
Value *BitMaskTag = llvm::ConstantInt::get(IntTy, 0xFFFF'0000'0000'0000, false);
IntTag = Builder.CreateBinOp(llvm::Instruction::BinaryOps::And, IntTag, BitMaskTag);
Expand Down

0 comments on commit a28e444

Please sign in to comment.