[llvm] db00953 - Fix bitcode decoder error in "Encode alignment attribute for `atomicrmw`"

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 19:30:05 PST 2021


Author: James Y Knight
Date: 2021-02-11T22:29:03-05:00
New Revision: db00953ff32aa3c64200871ae4bcd15a776acca0

URL: https://github.com/llvm/llvm-project/commit/db00953ff32aa3c64200871ae4bcd15a776acca0
DIFF: https://github.com/llvm/llvm-project/commit/db00953ff32aa3c64200871ae4bcd15a776acca0.diff

LOG: Fix bitcode decoder error in "Encode alignment attribute for `atomicrmw`"

The wrong record field number was being used in bitcode decoding,
which broke a self-hosted LTO build. (Yet, somehow, this _doesn't_
seem to have broken simple bitcode encode/decode roundtrip tests, and
I'm not sure why...)

Fixes commit d06ab79816785fa362e7d96d7a398bea8064cba7

Added: 
    

Modified: 
    llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 4a77f8c5f6d8..2911eb57033c 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -5181,7 +5181,7 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
       MaybeAlign Alignment;
 
       if (NumRecords == (OpNum + 5)) {
-        if (Error Err = parseAlignmentValue(Record[6], Alignment))
+        if (Error Err = parseAlignmentValue(Record[OpNum + 4], Alignment))
           return Err;
       }
 


        


More information about the llvm-commits mailing list