Wrong parameter was passed in. Fixed now.
authorweiyu <weiyuluo1232@gmail.com>
Fri, 12 Jul 2019 22:15:27 +0000 (15:15 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Fri, 12 Jul 2019 22:15:27 +0000 (15:15 -0700)
CDSPass.cpp

index 19b3a40..c0bd244 100644 (file)
@@ -699,7 +699,7 @@ bool CDSPass::instrumentAtomicCall(CallInst *CI, const DataLayout &DL) {
 
                Value *ptr = IRB.CreatePointerCast(OrigPtr, PtrTy);
                Value *val = IRB.CreatePointerCast(OrigVal, Ty);
-               Value *order = IRB.CreateBitOrPointerCast(parameters[1], OrdTy);
+               Value *order = IRB.CreateBitOrPointerCast(parameters[2], OrdTy);
                Value *args[] = {ptr, val, order, position};
 
                Instruction* funcInst = CallInst::Create(CDSAtomicStore[Idx], args);