Wrong parameter was passed in. Fixed now.
[c11llvm.git] / 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 *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);