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 19b3a402ab8e7ef12b471346616aa3f1a4e9a63e..c0bd2446930365fe8a40d0ca8d35489876e0967f 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 *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);
                Value *args[] = {ptr, val, order, position};
 
                Instruction* funcInst = CallInst::Create(CDSAtomicStore[Idx], args);