From 26793ed9749cf8999b2219d5d52a7b7a05bed505 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 25 Jan 2010 21:55:39 +0000 Subject: Fix the bitcode reader to deserialize nuw/nsw/etc. bits properly in the case of a forward-reference, which doesn't use an "abbrev" encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94454 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Reader/BitcodeReader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 2549a5162c..6dae45f384 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1702,12 +1702,12 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { if (Opc == Instruction::Add || Opc == Instruction::Sub || Opc == Instruction::Mul) { - if (Record[3] & (1 << bitc::OBO_NO_SIGNED_WRAP)) + if (Record[OpNum] & (1 << bitc::OBO_NO_SIGNED_WRAP)) cast(I)->setHasNoSignedWrap(true); - if (Record[3] & (1 << bitc::OBO_NO_UNSIGNED_WRAP)) + if (Record[OpNum] & (1 << bitc::OBO_NO_UNSIGNED_WRAP)) cast(I)->setHasNoUnsignedWrap(true); } else if (Opc == Instruction::SDiv) { - if (Record[3] & (1 << bitc::SDIV_EXACT)) + if (Record[OpNum] & (1 << bitc::SDIV_EXACT)) cast(I)->setIsExact(true); } } -- cgit v1.2.3-18-g5258