[lld] cbf99e0 - [WebAssembly] Fix faulty logic in verifyRelocTargets

Wouter van Oortmerssen via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 18:20:10 PDT 2020


Author: Wouter van Oortmerssen
Date: 2020-04-16T18:19:56-07:00
New Revision: cbf99e0fbab5248d949970f104ff4c14c3100b22

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

LOG: [WebAssembly] Fix faulty logic in verifyRelocTargets

Added: 
    

Modified: 
    lld/wasm/InputChunks.cpp

Removed: 
    


################################################################################
diff  --git a/lld/wasm/InputChunks.cpp b/lld/wasm/InputChunks.cpp
index 077f2deac72e..81ca83d40e39 100644
--- a/lld/wasm/InputChunks.cpp
+++ b/lld/wasm/InputChunks.cpp
@@ -78,7 +78,7 @@ void InputChunk::verifyRelocTargets() const {
     if (bytesRead && bytesRead != 5)
       warn("expected LEB at relocation site be 5-byte padded");
 
-    if (rel.Type != R_WASM_GLOBAL_INDEX_LEB ||
+    if (rel.Type != R_WASM_GLOBAL_INDEX_LEB &&
         rel.Type != R_WASM_GLOBAL_INDEX_I32) {
       uint32_t expectedValue = file->calcExpectedValue(rel);
       if (expectedValue != existingValue)


        


More information about the llvm-commits mailing list