aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2024-11-18 09:25:02 +1100
committerLang Hames <lhames@gmail.com>2024-11-18 10:38:50 +1100
commit521c99627690e09ba25383c83232f94ff457f00c (patch)
tree4d8df849c1dcd56871bb7349ba875a365378089a /llvm/lib
parent315519917368dce841f1cb1e7b296846d13497c3 (diff)
downloadllvm-521c99627690e09ba25383c83232f94ff457f00c.zip
llvm-521c99627690e09ba25383c83232f94ff457f00c.tar.gz
llvm-521c99627690e09ba25383c83232f94ff457f00c.tar.bz2
[JITLink] Move Symbol to new block before updating size.
Symbol::setSize asserts that the new size does not overflow the containing block, so we need to point the Symbol at the correct Block before updating its size (otherwise we may get a spurious overflow assertion).
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ExecutionEngine/JITLink/JITLink.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
index ef382c3..ba30a76 100644
--- a/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
@@ -204,9 +204,9 @@ std::vector<Block *> LinkGraph::splitBlockImpl(std::vector<Block *> Blocks,
auto TransferSymbol = [](Symbol &Sym, Block &B) {
Sym.setOffset(Sym.getAddress() - B.getAddress());
+ Sym.setBlock(B);
if (Sym.getSize() > B.getSize())
Sym.setSize(B.getSize() - Sym.getOffset());
- Sym.setBlock(B);
};
// Transfer symbols to all blocks except the last one.